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

Picture compression function #7704

Closed
KormiMeiko opened this issue Aug 26, 2021 · 8 comments · Fixed by #8216
Closed

Picture compression function #7704

KormiMeiko opened this issue Aug 26, 2021 · 8 comments · Fixed by #8216
Labels
✨Feature This adds/improves/enhances a feature

Comments

@KormiMeiko
Copy link

Summary

I hope you can add a compressed file size function to the image upload

@KormiMeiko KormiMeiko added the ✨Feature This adds/improves/enhances a feature label Aug 26, 2021
@Johann150
Copy link
Contributor

I think if you want to compress the file, you should do it before uploading. If Misskey has to compress the file, it could be complicated.

@tamaina
Copy link
Contributor

tamaina commented Aug 27, 2021

I think it would be useful, since continuously uploading large images can stress drive space.

@tamaina
Copy link
Contributor

tamaina commented Aug 27, 2021

Maybe there should be an option to save only the webpublic and not the original.

@KormiMeiko
Copy link
Author

KormiMeiko commented Aug 27, 2021

I think it would be useful, since continuously uploading large images can stress drive space.
I agree with this view very much!
There may be another way:
#7732

@KormiMeiko
Copy link
Author

I think if you want to compress the file, you should do it before uploading. If Misskey has to compress the file, it could be complicated.

Maybe so, but I just want to have this function to make it as convenient as possible for community users~

@Johann150
Copy link
Contributor

continuously uploading large images can stress drive space

There is a drive size limit. So users should pay attention to how much space they have left. And then they hopefully notice that it may not be much and know to upload smaller images. It is easy to do using e.g. Paint and resizing the image to a smaller size.

I just want to have this function to make it as convenient as possible for community users~

If it is easy for community users, then it is probably hard for developers.
Also it might be hard on the servers CPU, unless it is done with JavaScript. But using JS for this sounds like a bad idea to me.

@tamaina
Copy link
Contributor

tamaina commented Aug 27, 2021

hard on the servers CPU

Even now, Misskey servers always compresses the file when the image is uploaded.
(As for remote images, it depends on the instance settings.)

@mei23
Copy link
Contributor

mei23 commented Jan 22, 2022

クライアントで変換してあげるといい感じになる。
実装上はcanvas展開してブラウザでjpg変換しているので、変換もアップロードも速くなる。
https://github.com/mei23/misskey/blob/0df470cb0cc9269960a70cf043f4e116872ad58a/src/client/app/common/views/components/uploader.vue#L41-L53
https://github.com/mei23/misskey/blob/0df470cb0cc9269960a70cf043f4e116872ad58a/src/client/app/common/views/components/uploader.vue#L69-L70
※ただこれiOSあたりでorientationがおかしくなる疑惑あり

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature
Projects
None yet
4 participants