Skip to main content
Topic: [ADDON] Resize attached images (Read 15446 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [ADDON] Resize attached images

Reply #60
Can't answer to your question, just a note, don't use a 60% quality, it's too low as quality, you will notice the differences. I'd suggest you to use something about 80-85%, a normal jpg file resized to 1024 X 768 at 80% will be about 100-120 kb, which is already a  good result. 
sorry for my bad english



Re: [ADDON] Resize attached images

Reply #63
Russian localization.
Community of forum owners on any forum engine (сообщество владельцев форумов на любом форумном движке) https://forumovod.ru

Re: [ADDON] Resize attached images

Reply #64
Still using this add-on and running well, I have a suggestion for it:
My users are posting screenshots from phones, and most of them are .png files, which are taking more space than a .jpg file.
Here an example:
- the png file 909 Kb
- the jpg file I converted on my PC is only 172 Kb (converted with command "mogrify -format jpg *.png")
Since it's an image without transparency imho it has no sense to be saved as PNG. What I suggest, obviously if it's possible: if the png file does not contain transparency then save it as JPG, if has transparency leave it as PNG.

sorry for my bad english

Re: [ADDON] Resize attached images

Reply #65
Isn't that the Allow non-JPEG images to be reformatted to JPEG format when resizing setting?

Re: [ADDON] Resize attached images

Reply #66
Allow non-JPEG images to be reformatted to JPEG format when resizing.
 Selecting this option will allow the system to reformat non-JPEG images into the JPEG format when necessary. The system will try to maintain the existing format unless the resulting image is still in excess of the maximum file size allowed.


I just checked, I have that enabled, but is useless in my case because I have set high values for:
Max attachment size per post 9600 KB
Max size per attachment 5000 KB
Max number of attachments per post 15
sorry for my bad english

Re: [ADDON] Resize attached images

Reply #67
Allow non-JPEG images to be reformatted to JPEG format when resizing.
 Selecting this option will allow the system to reformat non-JPEG images into the JPEG format when necessary. The system will try to maintain the existing format unless the resulting image is still in excess of the maximum file size allowed.


I just checked, I have that enabled, but is useless in my case because I have set high values for:
Max attachment size per post 9600 KB
Max size per attachment 5000 KB
Max number of attachments per post 15
So I'm assuming that the addon was triggered by WxH image pixel size limits?  I like the idea of checking alpha channel info but would likely need another ACP option since right now it did what you specified (e.g. it falls within the constraints you set)

Re: [ADDON] Resize attached images

Reply #68
Here is something to test .... for 1.1 only .... Replace your existing file with this one (keep the old one safe in case you need to back out)

This will identify non transparent PNG files and if you have the checkbox to allow format conversion enabled, then it will change those non transparent PNG to a JPG (assuming the PNG was to big WxH or KB)

Sadly the only way to check for transparency is to examine every pixel in an image to see if it any have alpha value < 1.  This indicates that it has some level of transparency.  You can't simply trust how the file was saved (simple header read) since you can save a PNG that has no transparency with the transparency flag, thats just the way things work.

Should work with either GD or Imagick

Re: [ADDON] Resize attached images

Reply #69
Thanks for your support Spuds! This seem to work fine on my forum:
- uploaded PNG screenshot from mobile without transparency (BMW car), the image is saved as jpg (900 Kb in PNG -> 97 Kb in jpg format, size 1200 x 900). This is great, I just saved 0,8 MB with only 1 png image!  8)
- uploaded a small PNG file with transparency, the file was saved correctly as png with transparency (400 x 335 px, 30,9 KB -> same size, same dimension)
- uploaded a big PNG file with transparency (3500 × 2284 px, 982 KB -> saved as PNG with transparency 1200 x 783 px, 281 KB)

I only tested with Imagick. Thanks again!
sorry for my bad english

 

Re: [ADDON] Resize attached images

Reply #70
Cool, thanks for testing.  I'll pack this up and update the addon soon-ish