Attached Images Resizer, Converter & File Size Reducer

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Suggested Hosts
Post Reply
][Moon][Shine][
Registered User
Posts: 42
Joined: Fri May 03, 2013 9:46 am

Attached Images Resizer, Converter & File Size Reducer

Post by ][Moon][Shine][ » Sun Nov 16, 2014 6:40 am

This is not about just resizing displayed images as discussed in the ReIMG Image Resizer thread, but an extension that hooks itself to the attachment function and post-processes files if they are images.

The idea is to optimize forum performance by taking care of image type and file size. People tend to upload pics directly from their camera, resulting in megapixel images with several MB in size. Even if the displayed image is downsized to fit the max width of the posting area it is still stored and loaded in full size, eating away storage space on the server, as well as bandwidth and results in longer page load times (important for search engine rating).

So if a forum member uploads a picture as attachment, the file should automatically be resized to a configured value (like 800x600 or 600x800 keeping the aspect ratio) and converted to JPG with a configured JPG quality setting (like 80%) if it's a PNG or GIF (with the exception of animated GIFs; if such distinction is not possible than no GIF conversion, so that animated GIFs are still possible). AFAIK such functionality should easily be possible using ImageMagick, which is available on any webserver.

Such picture treatment has a huge impact. Right now I do that processing on my Vanilla forum manually (which is cumbersome if people upload a lot of pictures), and I can tell that it brings down pictures file sizes from up to 5 MB for regular pics directly coming from a camera to less than 100 KB most of the times.

It would be really great to have such automatic picture attachment treating available.

Holger
Registered User
Posts: 1752
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Holger » Mon Nov 17, 2014 10:42 am


][Moon][Shine][
Registered User
Posts: 42
Joined: Fri May 03, 2013 9:46 am

Re: Attached Images Resizer, Converter & File Size Reducer

Post by ][Moon][Shine][ » Mon Nov 17, 2014 3:21 pm

Great for sure, unfortunately with ReIMG it's all done on the client side, not on the server. In the end I'll use what's available, so that's great news the ReIMG is becoming an extension, but maybe someone else is interested in my described server side approach?

Holger
Registered User
Posts: 1752
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Holger » Mon Nov 17, 2014 3:23 pm

Why dont you want to outsource the resource to the client?

User avatar
Anv@r.all
Registered User
Posts: 191
Joined: Sun Sep 15, 2013 11:49 am
Location: bb3.mobi
Name: Anvar Stybaev
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Anv@r.all » Mon Nov 17, 2014 3:42 pm

[DEV/Beta] More extensions

Hopefully Google correctly translate my text// I do not support in private messages!

][Moon][Shine][
Registered User
Posts: 42
Joined: Fri May 03, 2013 9:46 am

Re: Attached Images Resizer, Converter & File Size Reducer

Post by ][Moon][Shine][ » Mon Nov 17, 2014 4:15 pm

Holger wrote:Why dont you want to outsource the resource to the client?
As said, because of storage space and page loading times. People tend to upload images directly from their cameras or mobile phones with multiple megapixel and several MB in size. We have a lot of pics in our forum and without server side re-formating / converting it has a huge negative impact especially on page loading times. It's not only about user experience (there are still a lot of people with slow internet access, me included) but also about search engine rating, because page loading time is a major factor for search engines.
Interesting find, I've just registered there to ask a question about that extension.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66568
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Lumpy Burgertushie » Mon Nov 17, 2014 5:27 pm

][Moon][Shine][ wrote: but also about search engine rating, because page loading time is a major factor for search engines.
straight from google:
While site speed is a new signal, it doesn't carry as much weight as the relevance of a page. Currently, fewer than 1% of search queries are affected by the site speed signal in our implementation and the signal for site speed only applies for visitors searching in English on Google.com at this point. We launched this change a few weeks back after rigorous testing. If you haven't seen much change to your site rankings, then this site speed change possibly did not impact your site.
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Holger
Registered User
Posts: 1752
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Holger » Mon Nov 17, 2014 6:53 pm

][Moon][Shine][ wrote:
Holger wrote:Why dont you want to outsource the resource to the client?
As said, because of storage space and page loading times. People tend to upload images directly from their cameras or mobile phones with multiple megapixel and several MB in size. We have a lot of pics in our forum and without server side re-formating / converting it has a huge negative impact especially on page loading times. It's not only about user experience (there are still a lot of people with slow internet access, me included) but also about search engine rating, because page loading time is a major factor for search engines.
Um, if you let the images resize on client side it wont take any resources from your server.
You can still decide the size and format the image shall have when it is uploaded.

You just save a lot of power on the server because all the work is done on client side, BEFORE upload to the server.

Maybe my understanding is not correct, but that is exactly what you are looking for!?

][Moon][Shine][
Registered User
Posts: 42
Joined: Fri May 03, 2013 9:46 am

Re: Attached Images Resizer, Converter & File Size Reducer

Post by ][Moon][Shine][ » Mon Nov 17, 2014 7:16 pm

Very strange, we just recently attended a Google AdWords seminar and we were told site speed / page loading time is an important factor for determining the importance of a site, which goes into relevance and ranking. But they also told us that it's a total split view between search engine and AdWords, so this indeed may be handled differently between the search engine and AdWords algorithms.

Nevertheless in our current forum we have exactly that problem, people uploading a lot of pics directly from their cameras and I can see myself that I can watch an image appear line by line because of it's size of up to 5 MB. Once I've resized down to 800x600 / 600x800 at 80% JPG-quality (server-side) filesize is only less than 100 kb in most cases, and pages load instantly.

All in all I'd prefer service-side downsizing and converting. Pics at 800x600 / 600x800 and 80% quality are more than enough for our forum use, we just don't need it HiDef, and there are just more advantages to it then client-side manipulation.

@Holger, it's not about saving power on the server, but preservation of storage space on the server (OK, that's not the main incentive, but we have a lot of pictures in our forum) and especially saving bandwidth and reduce page load times.

All what's done client-side still requires the whole data to be loaded into the user's browser first to then be manipulated.

So if you have a forum thread where someone uploaded 10 images each 5 MB in size your browser would first have to load 50 MB in data which are then to be manipulated. If those 10 images are already downsized and re-formated server-side on upload it's most likely will only be about less than 1 MB in data that has to be loaded, so this makes a huge difference.

Swanny
Registered User
Posts: 444
Joined: Sun Apr 14, 2002 2:11 am
Location: Canada

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Swanny » Tue Nov 18, 2014 2:40 am

I've been asking for this feature for years. I've given up, I do not have the skills to make such an extension.

It makes so much sense to make users lives easier. Upload any pic, and it gets automatically resized when it's uploaded to the server to a reasonable max size as set by admin. It saves disk space, bandwidth, etc. It's really win-win. For some reason everyone thinks ReIMG is amazing but really it's not even close to what we are looking for.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17052
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by DavidIQ » Tue Nov 18, 2014 2:53 am

Swanny wrote:For some reason everyone thinks ReIMG is amazing but really it's not even close to what we are looking for.
Because it fits in with what probably 99% of admins need. It's not really that amazing...it just does the job for most. In reality the number of admins that are looking for what you're requesting is a very small fraction in comparison.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 2330
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by kinerity » Tue Nov 18, 2014 3:52 am

][Moon][Shine][ wrote:People tend to upload pics directly from their camera, resulting in megapixel images with several MB in size.
You do realize you can limit the size of attachments, right? ;)
Kailey Truscott - Community Team

Holger
Registered User
Posts: 1752
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Attached Images Resizer, Converter & File Size Reducer

Post by Holger » Tue Nov 18, 2014 7:38 am

@][Moon][Shine][: I think you misunderstood the functionality (or maybe it is me misunderstanding).
With the ext ReIMG no internet connection will ever see the 5MB files.
If a user wants to UPLOAD a 5MB file and your board/ext-setting is different, then the image is resized BEFORE UPLOAD(!), client side. Noone will ever see/load the 5MB image.

Edit:
Hmmmm, I am reading the ReIMG ext-description again and again, I might have misunderstood the functionality!
I KNOW that there is a client side script (doing the above) available for phpBB 3.0.12:
http://www.phpbb.se/viewtopic.php?p=52039#p52039
Someone might want to look into this?

][Moon][Shine][
Registered User
Posts: 42
Joined: Fri May 03, 2013 9:46 am

Re: Attached Images Resizer, Converter & File Size Reducer

Post by ][Moon][Shine][ » Tue Nov 18, 2014 8:30 am

kinerity wrote:
][Moon][Shine][ wrote:People tend to upload pics directly from their camera, resulting in megapixel images with several MB in size.
You do realize you can limit the size of attachments, right? ;)
And that's exactly NOT the point. In my community most users are not that accustomed to using a computer, and although I have tried to explain how easy it is to process images before uploading they are simply overextended. If I limit the size of attachments it would mean they still would try to upload pics directly from their cameras, they would get an error message about too large file size, and because they can't help themselves they simply would refrain from uploading their pictures instead of trying to solve the issue, which is not the desired outcome.
Holger wrote:Hmmmm, I am reading the ReIMG ext-description again and again, I might have misunderstood the functionality! I KNOW that there is a client side script (doing the above) available for phpBB 3.0.12:
http://www.phpbb.se/viewtopic.php?p=52039#p52039 Someone might want to look into this?
Yes, that's what I was trying to explain. But it makes no sense at all to make this functionality client-side, it's something that should simply hook into the upload function to do the processing after an upload on the server. With ImageMagick it definitely is possible, but I am in no position to create an extension.

I guess doing that functionality client-side would be possible as well (as the mentioned mod does, I assume) with the benefit of saving bandwidth for the uploader, but it would be unreliable, depend on the used browser and may not work at all if for example uploading from a mobile phone, so I don't think that's the way to go.

As said, I'm no coder but I think that function should extend the upload function by checking with file-type has been uploaded, if it's identified as PNG or JPG it should get downsized to a defined resolution keeping the ratio and saved as JPG with a definied JPQ-quality setting (an additional bonus would be to strip EXIF data in case someone has GPS data included). I know that sounds easy and it may not be that simple to program, I know about ImageMagick and PHP GD but not how it works.
DavidIQ wrote:
Swanny wrote:For some reason everyone thinks ReIMG is amazing but really it's not even close to what we are looking for.
Because it fits in with what probably 99% of admins need. It's not really that amazing...it just does the job for most. In reality the number of admins that are looking for what you're requesting is a very small fraction in comparison.
I have no idea why any admin would NOT want this functionality, as it has only advantages. Why would an admin not want to save bandwidth, server storage space and optimize page load time?

Maybe most admins simply don't know about the impact of that feature, but if explained and shown the benefits I guess everybody will want to have it! ;)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17052
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Attached Images Resizer, Converter & File Size Reducer

Post by DavidIQ » Tue Nov 18, 2014 11:24 am

][Moon][Shine][ wrote:I have no idea why any admin would NOT want this functionality, as it has only advantages. Why would an admin not want to save bandwidth, server storage space and optimize page load time?

Maybe most admins simply don't know about the impact of that feature, but if explained and shown the benefits I guess everybody will want to have it! ;)
Because most admins won't allow uploading of massive amounts of images or large sized images to their servers through the upload feature. That is why the img BBCode exists and why many wouldn't benefit a whole lot from this. ;-) In fact the only way to target img BBCode referenced images for this "slimming" would be to store them locally so it would actually hurt the very thing you say is advantageous.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

Post Reply

Return to “Extension Requests”