I've seen some discussion about this but no real final extension to accomplish this. And I know others have asked, so I'm not the first/only one, but why not an extension that takes the uploaded image, has a slider (in ACP) for max dimensions, another slider for file size, then stores this version of the image while deleting the original file from the server.
I know the Xenforo forum I used to belong to has this feature and it makes it real easy to post images, esp for non-techy members.
I'm not a code warrior and suspect this isn't as easy as it looks in my head, but would hope someone here is experienced enough to tackle this and/or tell me why it's not going to work or is very hard to code.
"The good news is hell is just the product of a morbid human imagination.
The bad news is, whatever humans can imagine, they can usually create." - Harmony Cobel
solaria5505 wrote: ↑Tue Mar 08, 2022 2:42 pm
.... makes it real easy to post images, esp for non-techy members.
I'm not sure what I'm missing here but there really is no max dimensions the client can upload as long as they have JS enabled. if you set the max dimensions plupload will resize the image within those dimensions client side and the resized image is uploaded.
Determine what average max file size is for .png and then set the max file size for images a little higher. That's to insure someone with js disabled is not uploading a huge file.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”
thecoalman wrote: ↑Sun Mar 20, 2022 3:33 pm
I'm not sure what I'm missing here
I think the poster is saying that if someone uploads an unmodified image from their phone which is about 2mb, they want phpBB to resize the file size,
So the smaller the image dimensions = the smaller the file size, phpBB will then delete the original file and only save the 1mb version.
A lot of people uploading 2mb files and storing them on your hosting isn't ideal, so if phpBB shrunk the file size, it lightens the load on hosting space.
Most of us will enjoy Christmas in the comfort of our own homes this year, however, sadly, that can't be said for people in the Ukraine who are suffering day after day, due to the Russian invasion.
If you would like to make a small donation to help Ukrainians in their time of need, you can donate to help all Ukrainians via BritishRedCross or you can donate to help the Ukrainian children via Unicef. Thank You
Resizing necessarily creates a smaller file with some small exceptions. Most of the image files uploaded are going to be .jpg, if you set the max dimensions at 2000px * 2000px .jpg files are going to be in the 300KB range. If that file size is too big, reduce the resolution.
One exception is going to be a .png (and other formats), .png might be 1 to 1.5MB with those dimensions. .png is lossless, while there is specialized tools that reduce the file size, on a server the only option is to reduce the resolution.
Another exception is a .jpg with dimensions smaller than max dimensions that was originally saved at high quality. .jpg has a quality slider and most cameras default to 100%, opening it in an editor or running it through something like plupload reduces the file tremendously even with 85% quality. This can be fixed by forcing pluplaod to resmaple .jpg images if they exceed X size.
Another exception is if you have high file size max to accommodate .png, if someone disabled JS they would be able to upload an unnecessarily large .jpg. Looking at the "manage Extension Groups" it appears you can actually split .jpg into it's own image group so this can be solved through ACP.
I'm not necessarily against more image control but the point is you already have a significant amount of control over this. If the expectation is that most of the files uploaded are going to be .jpg you can pretty much set the max dimensions and be done with it.
---------edit--------
If this was proposal what I would like to see is max image dimensions per image and extend the file resizing to core when JS is disabled. Why server side resizing wasn't included since 2007 is one life's mysteries.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”