38 Commits

Author SHA1 Message Date
0ae84bc419 fix(router): improve remote URL parsing and logging 2024-10-23 02:42:59 +08:00
0a36dd5284 refactor(handler): streamline file streaming and improve concurrency handling 2024-10-23 02:05:47 +08:00
85e0534523 chore(Dockerfile): Update Dockerfile to use Alpine Linux and refactor package management
Update Dockerfile to use Alpine Linux for base image and refactor package management to use apk instead of apt. Also, clean up cache directories after installing packages.
2024-10-23 01:16:23 +08:00
52e885d3ec chore(router): add os package and ensure target directory exists
remove unused image files
2024-10-23 00:23:59 +08:00
8381e24fc4 feat(handler, schedule): improve error handling and logging for file downloads and cleanup 2024-10-22 23:52:57 +08:00
8b6defa69c refactor(router): add file size check before image processing 2024-10-22 23:27:07 +08:00
c5ed3a1fea feat(encoder): add ProcessAndSaveImage function to handle image processing and saving 2024-10-22 22:36:58 +08:00
be7aed64a9 refactor(encoder): Update log messages and helper functions for better readability and maintainability 2024-10-22 21:45:47 +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
c8f3d0bf38 进一步优化日志 2024-10-22 19:32:22 +08:00
4aea178ab0 100KB以下不处理, 调整日志 2024-10-22 18:20:59 +08:00
e7c2a50e2f 改为100KB以下不处理 2024-10-22 18:18:39 +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
cad6e95686 refactor(encoder, handler, schedule): Update error messages and code style for better readability 2024-10-22 16:56:42 +08:00
b6231118df Update root path welcome message and remove glib_malloc and jemalloc docker-compose files 2024-10-16 15:11:52 +08:00
fef4228f7c 修复了非图片文件请求的处理逻辑,优化了本地和远程资源的区分和重定向方式。 2024-09-29 16:10:22 +08:00
b85b0c6260 修复了路径检查和根路径请求的处理,优化了代码结构。 2024-09-29 15:19:57 +08:00
585f9a52b8 尝试修复非图片文件的重定向问题,并优化了代码结构。 2024-09-29 15:17:45 +08:00
0b494e08ac 尝试修复无限重定向 2024-09-29 15:04:43 +08:00
b5fb5b84a0 fix 2024-09-29 02:18:49 +08:00
08be6ef926 fix 2024-09-29 02:13:10 +08:00
85362aad22 修复 2024-09-29 01:39:46 +08:00
214d189e24 尝试修复 2024-09-29 01:37:44 +08:00
77801f29fa 尝试修复 2024-09-29 01:08:37 +08:00
34092a41b0 非图片文件会302重定向到原始链接 2024-09-29 00:47:33 +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
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
d83f6667cc
Refine convert part (#303)
* Refine convert part

* Only open image once

* More refine
2023-12-16 20:12:42 +01:00
Nova Kwok
4a90b18a63
Fix bug that could remove original image (#287)
* Fix bug that could remove original image

* Refine notice
2023-11-04 22:22:56 +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
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
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
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