-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance(client): Compress non-animated PNG files #9334
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #9334 +/- ##
===========================================
- Coverage 22.48% 22.48% -0.01%
===========================================
Files 700 700
Lines 65486 65489 +3
Branches 2120 2120
===========================================
Hits 14723 14723
- Misses 50763 50766 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
jest周りは分離してPRを出してください |
本音としてはwasm-vipsでバックエンドと同じ結果を得たいけど、SafariがSIMDに対応してないのでダメということらしい |
PNG to PNG、やっぱりサイズが大きくなってしまわないかしら (縮小の時だけ処理するとかがいいのかも |
しかしpngをjpegに圧縮するのは許し難い |
なんかややこしくなりそうですが、一斉quality 95 WebPにしたらどうですか |
webp
|
送信サイズの削減だけをねらうならいっそのことwasm-avif でavif にしちゃった方が良さそう |
圧縮の後のサイズチェックを追加してみました |
良さそう |
is-file-animatedってavif対応しないのかしら? |
/deploy sha=d1fce3664cc9cb9396643463ec3651d804bcee4e |
Your preview environment pr-9334-syuilo has been deployed. Preview environment endpoint is available here |
圧縮前か圧縮後のどちらを使ったかをconsole.logで知りたい (if (DEV)で)(風呂に入るけど) |
もっと情報をロギングするようにしました。JPGは圧縮したら悪くなる場合が多いことが判明。 PNGは意外と悪くなかったです |
/deploy sha=163b5e4 |
ブラウザによって圧縮率が異なるかもしれない |
ふむ。PNGもJPGもChromeでもうちょっと小さくなることがわかりました どっちも圧縮したら悪くなる場合が少なくないのでこれは役に立つかも |
…ところで: 今のままだとNODE_ENVが強制的にproductionにされてしまう |
|
Windowsで (でもなんかbackendビルド終わってないのにbootしようとします) |
yarn devはvite build --watch --mode developmentだから…まあローカルはこれでいいのか (okteto環境でもdevelopmentで動いて欲しいという話)
通常運行 |
yarn devのvite build --watchは妥協案で、やっぱりHMRで動かしたいと思っている |
一応しゅいろにレビューリクエストするか |
p1.a9z.devでテスト中 |
👍 |
* style: fix TS lint errors about `ev.target` * enhance: compress non-animated PNG * PNG to PNG? * defer jest things (add it later) * Delete jest.config.cjs * check the compressed file size * log compression stats * use ?? * handle if ($i == null) Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Fixes #9277
What
is-file-animated
that parses image header from a Blob to detect whether it's an animated image.compress-config.ts
frompackages/client/src/scripts/upload.ts
compress-config.ts
, with additional setup to run Jest for clientWhy
Additional info (optional)