Skip to main content
Topic: Client side image resize (Read 72 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Client side image resize

Anyone messed around with client side image resizing?  Sure, there is an image resize elk addon which works wonderfully!  That said, what if images could be resized before they're even uploaded?  Saving bandwidth as well as time could improve site functionality, particularly for mobile users.  Would anyone be willing to package it as an addon?  Or perhaps it could be part of the core?

Here's a discussion on client side resizing:

https://processwire.com/talk/topic/9814-client-side-image-resizing/

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
Bugs creator.
Features destroyer.
Template killer.

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...
sorry for my bad english

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 #5
But what if we could save bandwidth at upload time?
Reading the page linked from the page you linked:
Code: [Select]
    // Enable image resizing, except for Android and Opera,
    // which actually support image resizing, but fail to
    // send Blob objects via XHR requests:
So, that particular solution won't work on mobile, but it's also 3 years old, so maybe now something works. Needs testing. *nods*


Questions: Is it worth it?
It is interesting to try for sure. It may be more consistent, but it may be more browser-dependant (as usual).

What is needed to get this done properly?
At the moment I'm not sure.
The drag&drop interface has already a "trigger" function and the concept of events, it has just a couple that I used to plug-in the sharing thingy, but the concept can be extended easily, sort of hooks basically.

Do we need to check or install any software before hands?
Likely some javascript library.

Can this software be immediately used in ElkArte without much hacks?
Who knows. :P
Bugs creator.
Features destroyer.
Template killer.