Welcome Guest, Not a member yet? Register   Sign In
Possible Bug in Image_lib. Not severe, but maybe not logical in functionality. Please review.
#1

[eluser]Ichabodcole[/eluser]
I'm not sure if this should be reported as a bug, but it certainly caused me some grief, as it did not function the way I expected it too.

I am working on a gallery an noticed that if you resize several images in a for loop the following happens.
Lets say you have several different images you want to size down that have varying proportions meaning some are vertically long while others are horizontally long.Now if you also have maintain_ratio set to TRUE, after the first photo is resized the rest will all be sized along the first images largest proportion.

So if you size two images and the first one is wider than it is long it will be resized so that that its horizontal aspect fits with in the size you set, however if the next image has a longer vertical aspect ratio instead of sizing that to be the largest dimension is still sizes along the previously set dimension in this case it would be the horizontal dimension.
Basically this can lead to images that are larger than you have set them to be.

After some tinkering I found that the reason being was that the var "master_dim" in the image_lib library does not get reset after resizing, even though it starts with a default value of 'auto' and even if you set it to 'auto' manually. It also is not reset if you call the clear() method. The fix is of course to manually set it to 'auto' within the loop so that it gets reset every time, however this is not made clear in any documentation and to me seems like it should logically reset to 'auto' after the resize function is called.

Sooo, with that lengthy explanation should this be reported as a bug in the bug tracker?
#2

[eluser]Derek Allard[/eluser]
Thanks, and the explanation was great. I see so many bugs that are just "$feature doesn't work" and I'm stuck having to search things out and guess Wink

Yes, please do submit this as a bug. Welcome to CI lchabodcode, and thanks for contributing!
#3

[eluser]Doosje[/eluser]
Thanks a lot !
I've added it quick in my image_lib -> clear function ..so it's get reset.
Now my resizer en watermarker works great !!!
Hope it will be fixed in the next release.




Theme © iAndrew 2016 - Forum software by © MyBB