Re: Feature request: Image Proxy
Reply #61 –
The problem is really with ElkArte.
The image cache calls the function resizeImageFile() function which in turn will call function resizeImage() but it does so with the $force_resize flag set to true (no way to override that either, at least from that path).
The Imagick logic prevents $force_resize from scaling an image up, however the GD functions will let it scale up. So that is what we are seeing here.
So the question becomes what is wrong ... In some respects the Imagick is not honoring the force_resize flag, so that really is a bug even though in this case its producing what we want. GD is doing whats its told, although its horrible. function resizeImageFile() should really allow us to pass the force flag value.
Anyway something needs to be changed, just not sure which one !
Re: Feature request: Image Proxy
Reply #64 –
Yeah, I think the scale up is more a relic of when the template was composed of only nested tables and have all the images of the same size was the only way (or at least an easy way... or at least a consistent way across browsers LOL) to ensure some consistency of the whole thing.
Re: Feature request: Image Proxy
Reply #68 –
Just thinking out loud, I'd probably add a new function to the image cache class and drop the dependency on resizeImageFile Right now some of those graphic functions have an inflexible flow, at least resizeImageFile does.
So I'd add a custom handler to the fetch the image (using the good parts of resizeImageFile, and call it fetchImageFile) in the cache class Then you can control what resize function to call, a new resizeGifImage or the existing resizeImage. resizeGifImage could be added to graphic.subs so its available to other addons as well.
Have not looked to see if GD can handle animated gifs, if not its fine IMO to just have an imagick function.
Just some quick thoughts.
Re: Feature request: Image Proxy
Reply #70 –
Do nothing, if sized right, can be an option.
Re: Feature request: Image Proxy
Reply #72 –
Yup we are on the same page. To be cautious, if the image is below the size limit and we just want to save it, we can run the image through checkImageContents() It is possible for a gif to hide meta data that could get executed on a poorly configured server, and then if you could find the file.