Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Downsize images on upload#107

As someone who has almost every client uploaded 5,000px camera phone images straight from the phone, it would be great to be able to downsize them to something more sensible.

Whilst this can be done with an upload hook if you know what your doing, it would be greate to be able to do it via blue print settings on the upload options for fields and sections.

4 years ago
Changed the title from "Image downsize on upload" to "Downsize images on upload"
4 years ago
3 years ago

@Oliver Sure, but the point is it would be nice if you didnt need the plugin and you could resize via blueprint.

3 years ago

@Hello: I agree with you that’s why I also upvoted your suggestion :-)

3 years ago

maybe also resize them directly in the browser before uploading them :)

3 years ago

As we’re already messing with the original image data, then it would be nice if we could also change the FILE FORMAT - e.g., resize and save as WebP (or AVIF), instead of the original.

3 years ago
1

@Roman Steiner While I get the benefits of already downscaling in the browser, adding an implementation that does this and supports multiple image formats seems like a bigger task (and maintaining that alongside oru backend file processing). So it would be probably more feasible to rely on server-side processing.

3 years ago

Also we are talking about backend rescaling on upload now, so Kirby’s thumb engine will need the RAM anyway. When rescaling in the frontend it might indeed make more sense to reduce the strain on the server by limiting the maximum total file size.

3 years ago

Does the thumb engine wait for them to processed one by one with a batch upload or try to do as many as it can in parrallel? Can only see ram being a bigger issue if trying to do them in parrallel. I guess if you add in WebP conversion at the same time, this get intensive quite quickly.

3 years ago

I guess performance can be tuned if its in the core though. I know from testing my WebP plugin with the downsize hook also active - i uploaded about 10 images at once ranging from 2mb to 14mb file size each and the conversion / downsize didnt take a horrible amount of time with the PHP ram set to 512mb. Perhaps 10 - 15 seconds.

3 years ago

I used this in my plugin if its helpful https://github.com/rosell-dk/webp-convert

3 years ago

Yeah, that could indeed become an issue. It’s difficult to do queing in PHP without a central database or daemon, so I think the only option would be that each thread that receives an uploaded image rescales it instantly (= in parallel).

3 years ago

@Nico, any very tall or wide image that contains text.
Typical example could be web comics; typically intended to be viewed on a smartphone: width is limited to that of the screen (something like 400 ~ 500 px), height is given by the content and has no limit.

Resizing 5000x5000 to 2500x2500 is ok, because the image is seen anyway at about 400x400.
Resizing 400x5000 to 200x2500 would mean the image is then seen at half of the intended resolution, pixelating it or, worse, making the text unreadable.

But hey, it was just something to consider… or not.

3 years ago
Changed the status to
In upcoming releases
a year ago
1
Changed the status to
Completed
4 months ago