Fixed
Details
Assignee
Michael OffnerMichael OffnerReporter
Barbara RenowdenBarbara RenowdenPriority
CriticalLabels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
NoneAffects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Barbara Renowden
Barbara RenowdenPriority
Labels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Affects versions
Created 9 April 2019 at 17:31
Updated 24 September 2020 at 08:25
Resolved 16 August 2019 at 06:08
This issue originally started on a forum post. https://dev.lucee.org/t/image-rotate/5374/4
We thought we had this resolved but I was informed that there were still issues with the image rotate functionality. I was provide with a couple of images that were acting up when we tried to rotate right (i.e. 90 degrees) despite the fact that I had the fix in place. I spent some time trying to figure out why some images worked fine and some didn’t, trying .png files instead of .jpg and then larger files rather than smaller but it all seemed rather random. Finally I noticed that the images that were throwing the exception had one thing in common, the dimensions that were not even.
To test my hunch I went to the Lucee documentation on image rotate since they had code that you could run. I modified the code on that page to create an image that is 100x99 rather than 100x100 and then ran it with rotation angles of 270 (rotate left) and 90 (rotate right) and sure enough the rotate right throws the exception. I’ve provided the link and screen shots of each below.
I also tried this:
<cfscript> img=imageNew("",100,87,"RGB","0fb9b1"); imageRotate(img, "90"); cfimage(action="writeToBrowser",source=img); </cfscript>
When this happens it throws an error;
Error:
java.lang.ArrayIndexOutOfBoundsException You can try this yourself here.
https://docs.lucee.org/reference/functions/imagerotate.html
My issue is that some of our users may not upload a perfectly dimensioned image. And it seems that only Odd numbers have the issue. If you change to an even number the image rotates fine.