misskey icon indicating copy to clipboard operation
misskey copied to clipboard

Some favicons cannot be loaded / saved.

Open memo-567 opened this issue 2 years ago • 11 comments

💡 Summary

Some favicons cannot be loaded / saved.

🥰 Expected Behavior

Favicons should be saved and displayed.

🤬 Actual Behavior

mk hw2k com -  2023 - 02 - 26  14 - 35

📝 Steps to Reproduce

Logfile:

INFO *	[download]	Downloading https://chaos.social/packs/media/icons/android-chrome-36x36-4c61fdb42936428af85afdbf8c6a45a8.png to /tmp/tmp-1319-3XHancQuPy53 ...
DONE *	[download]	Download finished: https://chaos.social/packs/media/icons/android-chrome-36x36-4c61fdb42936428af85afdbf8c6a45a8.png
ERR  *	[server]	StatusError: Unexpected mime
INFO *	[download]	Downloading https://chaos.social/packs/media/icons/favicon-48x48-c1197e9664ee6476d2715a1c4293bf61.png to /tmp/tmp-1319-GShuvPKd9p70 ...
DONE *	[download]	Download finished: https://chaos.social/packs/media/icons/favicon-48x48-c1197e9664ee6476d2715a1c4293bf61.png
ERR  *	[server]	StatusError: Unexpected mime
INFO *	[metadata]	Fetching metadata of chaos.social ...
INFO *	[metadata]	Fetching nodeinfo of chaos.social ...
INFO *	[metadata]	Fetching HTML of chaos.social ...
DONE *	[metadata]	Successfuly fetched nodeinfo of chaos.social
DONE *	[metadata]	Successfuly fetched metadata of chaos.social
DONE *	[metadata]	Successfuly updated metadata of chaos.social

📌 Environment

Misskey versions: 13.7.5 / 13.8.0 / 13.8.1 Your OS: Debian 11 Your browser: all

memo-567 avatar Feb 26 '23 13:02 memo-567

sharpがICOはサポートしていないせいだと聞きました / I heard this is because sharp does not support ICO format.

saschanaz avatar Feb 26 '23 14:02 saschanaz

I don't know what this sharp is, but is there a fix for it?

memo-567 avatar Feb 26 '23 16:02 memo-567

ここから発生していますね / It's coming from here:

https://github.com/misskey-dev/misskey/blob/81e6a21fe06633adf50acd089f2005dfb10b95d4/packages/backend/src/server/FileServerService.ts#L261-L275

多分ICOファイルはそのまま使っていいかもです。/ I guess it's probably fine to skip conversion for ICO files 🤔

saschanaz avatar Feb 26 '23 16:02 saschanaz

icoファイルは大変大きいので、クライアントに読ませるのは避けたい

tamaina avatar Feb 26 '23 22:02 tamaina

ico 自体のデコードは楽なはず (e.g. https://github.com/image-rs/image/blob/master/src/codecs/ico/decoder.rs) なのでなんとかなってほしい

acid-chicken avatar Feb 27 '23 03:02 acid-chicken

This seems mostly affect custom favicons.

As long as it doesn't work properly, I've switched it off for now.

memo-567 avatar Feb 27 '23 11:02 memo-567

インスタンスのアイコンにこんなにico突っ込まれてたっけ?

tamaina avatar Mar 01 '23 11:03 tamaina

ico 自体のデコードは楽なはず

実装が簡単とは言わなかったな?

tamaina avatar Mar 01 '23 11:03 tamaina

Yes, it should usually display as shown in the screenshot.

mk hw2k com -  2023 - 03 - 01  12 - 24

It just doesn't seem to work with custom favicons. Not even with my Misskey instance's own custom favicon.

memo-567 avatar Mar 01 '23 11:03 memo-567

media-proxy v0.0.17で対応した

tamaina avatar Mar 03 '23 16:03 tamaina

本体メディアプロキシはまだ

tamaina avatar Mar 03 '23 16:03 tamaina