35 Commits

Author SHA1 Message Date
5e2052a711 refactor(api): migrate from Fiber to Gin framework
Migrate the web framework from Fiber to Gin for better performance and community support.
2024-10-28 16:56:29 +08:00
3353d014d4 调整以支持IMG_MAP情况下的本地路径 2024-10-22 20:18:09 +08:00
d872d71dcb feat(config, handler): Remove IMG_PATH config and update IMG_MAP handling, add root path greeting 2024-10-22 19:59:27 +08:00
f8b23a88f3 chore: Refactor workflow and Makefile, remove test files 2024-10-22 19:06:06 +08:00
9ee97eab9d refactor(config, handler): Update error messages and logging to Chinese 2024-10-22 17:05:33 +08:00
Nova Kwok
d29959cbd4
Bump to 0.12.0 (#345) 2024-06-29 16:46:15 +08:00
Nova Kwok
89ea0affa3
Add MAX_CACHE_SIZE config (#344)
* Add MAX_CACHE_SIZE

* Bump actions version

* Optimize code

* Use Ticker to control GC loop
2024-06-29 16:42:00 +08:00
Benny
be32328998
Fix Malformed dir traversal (#331)
* Directory traversal with malformed HTTP request

#330

* bump version

* also %2e

* Use prefix to check invalid Path

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2024-04-23 13:15:40 +08:00
Nova Kwok
c7bebfca34
Add EXTRA_PARAMS_CROP_INTERESTING (#328) 2024-04-19 10:06:05 +08:00
Nova Kwok
b5842b264c
Allow jxl based on Accept header (#326) 2024-04-10 04:11:33 +01:00
Nova Kwok
43c275e3ec
Adds JPEG XL support, max_height/max_width support (#321)
* WIP JXL

* Fix test

* Tries to fix autobuild

* Tries to fix autobuild

* Add setup go in codeql

* Bump actions version

* Do not print curl output in CI

* Do not print curl output in CI

* Remove Metadata on RAW image

* Update sample config

* better loop

* Prefetch should also respect AllowedType

* Better Export params and UA handle

* Only do conversion on supported formats

* CONVERT_TYPES default to webp only

* CONVERT_TYPES default to webp only

* Add GIF to AllowedTypes

* Update README
2024-03-22 15:12:09 +08:00
Nova Kwok
ca1050d3c7
Optimized Dockerfile, bump version (#318)
* Optimized Dockerfile, bump version

* Remove unused extraParams
2024-02-29 20:06:15 +08:00
Nova Kwok
9be1a6b1ed
Fix tests, bump version (#312) 2024-02-11 05:04:19 +01:00
HolgerHuo
123c96dde7
add: cache for remote images (#310)
* add: cache for remote image requests

* update: use default expiration for NoExpiration setting

* update: clean code

* fix: do not save empty etag

* fix: panic during type assertion
2024-02-11 10:55:23 +08:00
Nova Kwok
1ec981b1fb
Read all pages (#308)
* Read all pages

* Bump to 0.10.6
2023-12-29 21:24:56 +08:00
Nova Kwok
d35e0e0d0b
Lock on convert (#307)
* Lock on convert

* Fix typo

* Should use debug for convert lock

* Bump to 0.10.5
2023-12-29 19:38:05 +08:00
Nova Kwok
484c876e86
Bump to 0.10.4 (#304) 2023-12-18 15:36:29 +08:00
Nova Kwok
d83f6667cc
Refine convert part (#303)
* Refine convert part

* Only open image once

* More refine
2023-12-16 20:12:42 +01:00
Nova Kwok
c771160a05
Ignore GIF when converting to AVIF (#302)
* Ignore GIF when converting to AVIF

* Allow WebP as source
2023-12-01 20:26:27 +08:00
Nova Kwok
4f39a1c0b4
Unify ENV (#289) 2023-11-05 19:16:44 +08:00
Nova Kwok
543af2415f
Better configuration (#288)
* Better config

* print to log

* Upgrade golang.org/x/net

* Tidy go mods

* export WebpConfig

* Add TestConvertRawToJPG

* Add TestConvertRawToJPG

* Update Integration Tests UA

* Add README for supporting NEF

---------

Co-authored-by: Benny <benny.think@gmail.com>
2023-11-05 18:34:04 +08:00
Nova Kwok
655fb1dcca
Add env on startup (#283)
* Add READ_BUFFER_SIZE, CONCURRENCY,DISABLE_KEEPALIVE to ENV

* Add TestGuessSupportedFormat
2023-10-17 16:41:01 +02:00
Nova Kwok
5d265dce33
Parse flat before load config (#275)
* Parse flat before load config

* Bump version to 0.9.11
2023-09-15 14:13:30 +08:00
Nova Kwok
6790ddda46
Add support for Go 1.21, bump version, optimize code (#264) 2023-08-09 22:49:40 +08:00
BugFest
4003b03022
Multiple backends support (#207)
* Fix: h2non/filetype upgraded to support avif signatures

* Fix: make clean updated to include test/output dirs

* Feature: multi-backend support via IMG_MAP config key as described in #217

* feat: implement both local and remote (proxyMode) mappings for multi-backend

* Feature: multi-backend support via IMG_MAP config key as described in #217

* fix: go-is-svg should be direct import

* fix: imgMap paths are relative to CWD

* feature: IMG_MAP is parsed on start

---------

Co-authored-by: Nova Kwok <n0vad3v@riseup.net>
2023-08-02 23:33:54 +08:00
Nova Kwok
cd0a83a596
Update README and config.json (#260) 2023-07-21 15:41:26 +08:00
Nova Kwok
a7b9e90fab
Add SVG support for proxy mode (#258)
* Add SVG support

* Bump version
2023-07-21 15:35:30 +08:00
Benny
5f6c7cce1e
better reduction effect loop and bump (#256)
* better reduction effect loop and bump

* Bump version

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2023-07-19 10:10:21 +08:00
Nova Kwok
b988668893
Better ReductionEffort (#255)
* Better ReductionEffort

* Bump version
2023-07-18 23:17:34 +08:00
Nova Kwok
24b96a901b
ReductionEffort to 0 (#254) 2023-07-18 16:16:14 +08:00
Benny
a7b5992662
Metadata (#251)
* recover middleware

* simplify Atoi

* metadata data prototype

* InterestingAttention

* resize itself

* Bump version to 0.9.4
Added some comments
Removed String() for Extraparams

* Add metadata test

* Fix CI

* Remove unnecessary tests

* Update file count

* use t.Run to get test case

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2023-07-11 19:08:32 +02:00
Nova Kwok
a5e3282ea1
Move matcher to outside to avoid fatal error: concurrent map read and map write (#250)
* Move matcher to outside to avoid fatal error: concurrent map read and map write

* Bump to 0.9.3
2023-07-06 22:16:24 +08:00
Nova Kwok
fdca7eac0f
Bump to 0.9.2 (#247) 2023-07-05 16:01:29 +08:00
Benny
13281d929b
add some tests (#239)
* add some tests

* remove template

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2023-07-03 17:01:13 +08:00
Benny
23bbed8ce6
Refactor review (#220)
* runnable

* convert is working

* some refactoring

* update go.mod

* fix some TODOs

* add TODO

* update go mod

* rebase onto master

* fix #234

2: 5.9s - 7.6MB
4: 26s - 6.9MB

* fix malloc tests

* fix malloc tests

* remote TODO

* add X-Real-IP #236

* Better localRawImagePath

* remove some wrong comments

* Bump version to 0.9.0

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2023-06-27 15:43:43 +02:00