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

Re: [ADDON] Resize attached images

Reply #45

I don't use the fancybox addon, just this one. When I click on a large picture it opens in the same window as the forum. I wish it would open in a new window instead. So it's not this addon?  :-[

Re: [ADDON] Resize attached images

Reply #46

How an image is displayed is not a function of this addon.  If you are referring to the expand in place I think thats a function of the Max Displayed width setting, setting that to something low would I think force it to display in a new tab or window (which depends on how you have your browser set up and can't be controlled by the site)

Re: [ADDON] Resize attached images

Reply #47

Hm, okay. Can someone please split my post?  O:-)

Max width and height is set to 0 (no limit). Images like these are opened not under the post itself, but as a new page in the same window. What I wish when clicking on the thumbnail is that the images should always open in a new window (keeping the forum opened), no matter how wide or high.

I think that some users may close the image and the forum too by mistake.

I know the browser has such an option. But doesn't have the forum too?

Second problem: Some images are opened under the post, some or opened as a new page. How can I change that?

I never understood these settings.  O:-)

Re: [ADDON] Resize attached images

Reply #48

I believe this is they way those values work.

Leaving those at 0,0  means that the system will always try to expand the image under the post, even if that overflows the width of your page, that is the behavior I see on your site.

Setting that to, for example,  800,800 means that images 800,800 and below will expand under the post and images > 800,800 will instead open a new tab/window.

Setting that to say 1,1 should effectively force all images to open in a new window / tab  (there is no way to force it to open a new window if the user has their browser set to open new windows as a tab)

Re: [ADDON] Resize attached images

Reply #49

Quote from: Spuds – Leaving those at 0,0  means that the system will always try to expand the image under the post, even if that overflows the width of your page, that is the behavior I see on your site.

With my browser here at work these images are opened in the same window, not under the post. Hmmm...

Thanks for the explanation. I will check it at home later.

Re: [ADDON] Resize attached images

Reply #50

 emanuele feels Jorin has some weird browsers at work. :P j/k ;)
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Resize attached images

Reply #51

Seems so! lol

Re: [ADDON] Resize attached images

Reply #52

Quote from: Spuds – Cool .. I'll do some testing!

ETA:

Looking at your attachment settings, you have "Max size per attachment" set to 0, which means no limit.  This means there is no practical size limit imposed on an individual file.

The original PNG image was (1818 x 827) which is larger than the (1200 x 1200) limit you have set.  As such the file was proportionally resized to (1200 x 546) which saves some file size as expected (1Mb -> 541Kb)

At this point the program would check if 541Kb is at or under the individual size limit, and since you have no limit set, it passes that check and the program is done.

If however, and only for an example, you set a size limit of 400Kb, then the program would take that 541Kb oversize PNG and re-encode it as a JPG to see if it would then be <= 400Kb, and if so save it as that (a JPG). 

So again the Allow non-JPEG images to be reformatted to JPEG format when resizing."  setting 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.  If it can keep a PNG as a PNG, it will do so (since its lossless)\

Now I'm going to actually test :D

What do you think about the idea to split the field "Max size per attachment" in two fields:
1. Max file per attachment - checks only if the original attached file is bigger than the "Max file file per attachment". Let's say I can set this to 5 MB, so photos bigger than 5 MB won't be uploaded
2 Resize PNG for file bigger than:
let's say I can set this to 400 KB, so the addon can resize or convert to jpg only files bigger than 400 KB.

With the actual settings the images are resized correctly but I cannot post .zip or .pdf files bigger than 400 kb.
sorry for my bad english

Re: [ADDON] Resize attached images

Reply #53

Quote from: radu81 – With the actual settings the images are resized correctly but I cannot post .zip or .pdf files bigger than 400 kb.
 
 sorry if I insist on this, ore there any news?
sorry for my bad english

Re: [ADDON] Resize attached images

Reply #54

How about adding an option force all images to JPEG?

If I change the attachment size now, will it affect past attachments? or just the newly added one?
192.MY.ID: Forum ISP Indonesia.


Re: [ADDON] Resize attached images

Reply #56

I feel that an option to force everything to JPG will result in problems.  Converting a graphic that was intended to be a PNG to a JPG can sometimes really make it look quite awful.   Thats why the current system will only do that (when enabled) if the PNG image can't be made to fit inside the set limits.

Quoteelk, ? in avatar setting ?,  can auto-convert resized img to PNG.
CAN that be temporarily be altered to convert to JPG?
OT: If you don't have "Use PNG for resized avatars" enabled then they will be saved as JPG (assuming that the image has to be resized).

Re: [ADDON] Resize attached images

Reply #57


Can't say for sure the Elk version behaves this way. Using smf2.1 old attachments would get resized once they were viewed. Google bots resized every attachment on the forum!  Lol

Re: [ADDON] Resize attached images

Reply #58

Updated package to support ElkArte 1.1

Re: [ADDON] Resize attached images

Reply #59

Quote from: badmonkey –
Quote from: radu81 –
Quote from: kucing – or just the newly added one?
Just the newly attachments added

Can't say for sure the Elk version behaves this way. Using smf2.1 old attachments would get resized once they were viewed. Google bots resized every attachment on the forum!  Lol
Can this plugin be updated , that it also resizes and reduces the filesize for already uploaded pictures ?
Or is there any PHP Script with which I can do this manually , e.g. resize all image attachments to 1024x768 at quality 60 in Jpeg format to save server space ?
Many thanks.