Re: Client side image resize
Reply #1 –
That is something I think I considered at the time, but never managed to put together a proof of concept... that is usually what I push to repos for others to refine. xD
Re: Client side image resize
Reply #2 –
What about the add-on to resize images? Could be run as a schedule task? something similar like how smush.it addon works...
Re: Client side image resize
Reply #3 –
Sure. That is the fallback. It saves both storage as well as bandwidth on the download direction. But what if we could save bandwidth at upload time? It's far quicker to upload a smaller image. Especially from a phone with marginal data service. It saves server CPU too. Let the individual user pay that price. Could be beneficial to someone on shared hosting.
Re: Client side image resize
Reply #4 –
I like this idea but I don't have the slightest idea on how this could be done. I only understand that the needed "hack" is to modify if a file(s) is an image(s) during attachment process so it can be compressed or resized before it is saved.
Questions: Is it worth it? What is needed to get this done properly? Do we need to check or install any software before hands? Can this software be immediately used in ElkArte without much hacks?
Re: Client side image resize
Reply #8 –
On second thought, perhaps not that particular script. The demo quickly resizes but consistently stalls in the upload on a mobile platform. It actually takes longer than uploading a full size image - and that's on a good 4G connection!
Re: Client side image resize
Reply #11 –
In that case, I don't think working server-side is the easiest way, probably it's better to modify the javascript in sendFileToServer so that the file is set there directly already squashed.
Of even better, before the two calls of handleFileUpload so that you send to that function directly the smaller file and everything else works as it should. Both are in dropAttachments.js.
Here everything fine, yes, thanks!
And you?