Skip to content
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

feat(frontend): selectable compression kind #11760

Closed
wants to merge 1 commit into from

Conversation

anatawa12
Copy link
Member

issueの議論なしにpullreq失礼します。

What

  • サイズ変更を行うかを選択可能にしました
  • 強制的に非可逆圧縮できるようになりました

Why

https://misskey.niri.la/notes/9il57tmb30

圧縮劣化やリサイズがちょっと嫌で、そのためにオリジナルでしか上げてなかったので…

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

feat(frontend): selectable compression kind

Cherry-picks 300d272
@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Aug 24, 2023
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #11760 (ffe8a4c) into develop (e82c2e7) will decrease coverage by 0.06%.
The diff coverage is 19.31%.

@@             Coverage Diff             @@
##           develop   #11760      +/-   ##
===========================================
- Coverage    78.64%   78.59%   -0.06%     
===========================================
  Files          923      923              
  Lines        97475    97549      +74     
  Branches      7747     7747              
===========================================
+ Hits         76662    76671       +9     
- Misses       20813    20878      +65     
Files Changed Coverage Δ
...ges/frontend/src/scripts/upload/compress-config.ts 29.09% <19.31%> (-34.80%) ⬇️

noridev added a commit to kokonect-link/cherrypick that referenced this pull request Sep 8, 2023
@syuilo
Copy link
Member

syuilo commented Sep 11, 2023

ユーザー目線では、再圧縮や非可逆圧縮と言われてもあまり理解できないかも?

@tamaina
Copy link
Contributor

tamaina commented Sep 11, 2023

noresizeはサーバーで尊重されない(サーバーで再圧縮がかかる)はず

@tamaina
Copy link
Contributor

tamaina commented Sep 11, 2023

というか(何も改造していなければ)2048pxを超える画像はWeb公開用としてはサーバーサイドで再圧縮がかかっている

ただしサーバーサイドで再圧縮をかける際はpngはpngになる(sharp.jsだとlossless webpよりpngの方が圧縮率を高められるため)

@tamaina
Copy link
Contributor

tamaina commented Sep 11, 2023

jpegはサーバーサイドでwebpに変換されるがsmartSubsampleとかがあるのでブラウザよりサーバーサイドのsharp.jsの方が圧縮の性能がいい(のでオリジナル画像アップロードの方がいいよねという話なんだと思う)

@anatawa12
Copy link
Member Author

というか(何も改造していなければ)2048pxを超える画像はWeb公開用としてはサーバーサイドで再圧縮がかかっている

については私のミスで、実装糸としては大きく画像を表示したときに元画像が表示されてるのを意図していました。

"2048pxを超える画像はWeb公開用としてはサーバーサイドで再圧縮がかかっている"の実装意図は何でしょうか?明確なものがなければ消したいと思っています。

@tamaina
Copy link
Contributor

tamaina commented Sep 18, 2023

"2048pxを超える画像はWeb公開用としてはサーバーサイドで再圧縮がかかっている"の実装意図は何でしょうか?明確なものがなければ消したいと思っています。

画像サイズの低減を狙ったものであり、この制限を外すつもりはありません。

iPadであっても2048pxで十分ですが、avifが導入できれば4096pxに引き上げたいと思っています。

@anatawa12
Copy link
Member Author

anatawa12 commented Sep 18, 2023

なるほどです。

この変更はユーザがそのままの解像度の画像を見てほしいというユーザの声をもとに作成したものになります。そのためこの意図が達成できないのであればこのpullreqはCloseします。

想定プラットフォームは高解像度PCのつもりです

@anatawa12 anatawa12 closed this Sep 18, 2023
@tamaina
Copy link
Contributor

tamaina commented Sep 18, 2023

(ノート投稿フォームでオリジナル画像のURLを本文中に挿入する機能とかがあっても良さそう)

@anatawa12
Copy link
Member Author

ユーザが拡大して見たいと言ってクリックしたときとは別のリンクとして置く理由は私には理解ができていません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants