27 Commits

Author SHA1 Message Date
wood chen
4cc610809b
Merge pull request #5 from webp-sh/master
Add iOS 18 support
2024-10-30 17:04:25 +08:00
Nova Kwok
ae0274c39c
Add iOS 18 support (#360) 2024-10-30 10:13:41 +08:00
ffa5242983 feat(handler/router): add image file type checking and non-image file handling 2024-10-23 06:53:00 +08:00
8b6defa69c refactor(router): add file size check before image processing 2024-10-22 23:27:07 +08:00
be7aed64a9 refactor(encoder): Update log messages and helper functions for better readability and maintainability 2024-10-22 21:45:47 +08:00
c8f3d0bf38 进一步优化日志 2024-10-22 19:32:22 +08:00
f8b23a88f3 chore: Refactor workflow and Makefile, remove test files 2024-10-22 19:06:06 +08:00
9b6425777c feat(handler/router): 低于200k的图片直接跳过转换 2024-10-22 18:10:00 +08:00
c9cb32b0da 尝试优化内存占用
feat(encoder): optimize prefetch images with worker pool and progress bar
refactor(handler): improve downloadFile function with error handling
refactor(helper): use streaming JSON encoder for metadata
chore(webp-server): update server config with write buffer size
2024-10-22 17:26:43 +08:00
9ee97eab9d refactor(config, handler): Update error messages and logging to Chinese 2024-10-22 17:05:33 +08:00
fef4228f7c 修复了非图片文件请求的处理逻辑,优化了本地和远程资源的区分和重定向方式。 2024-09-29 16:10:22 +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
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
HolgerHuo
290b23355a
fix: incorrect cache key (#286) 2023-11-22 21:30:14 +08:00
Nova Kwok
4f39a1c0b4
Unify ENV (#289) 2023-11-05 19:16:44 +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
Benny
523294e6d1
fix image exist nil (#274)
#272
2023-09-15 12:01:26 +08:00
Nova Kwok
d9da7f3cd3
Remove metadata when original not exist, update support for heic (#266)
* Remove metadata when original not exist, update support for heic

* Warnf to Warnln
2023-08-17 12:30:53 +02: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
a7b9e90fab
Add SVG support for proxy mode (#258)
* Add SVG support

* Bump version
2023-07-21 15:35:30 +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
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
Nova Kwok
eea4537f22
iOS 16 supports AVIF and WebP (#242)
* iOS 16 supports AVIF and WebP

* iOS 17 should support WebP and AVIF too

* Determine image type by GetFileContentType
2023-07-03 16:57:47 +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