Hi all,
I have a problem determining the height and width of photos in jpg-format in pixels with ‘cfimage/info’. The height and width of photos in portrait format are often swapped, what causes problems when these photos are cropped in a later process. Some photos in portrait format are recognized correctly. Others won’t. I don’t see any regularity either.
These are the functions I use to determine height and width : <cfimage action="info" source="/mediadb/IMG_5766.jpg" structName="result">
or
<cfscript>
imgObj = imageRead("/mediadb/IMG_5766.jpg");
info = imgObj.info();
writeDump(info);
</cfscript>
Is there a reliable way to find out if a jpeg photo is portrait or landscape?
I would update your version of Tomcat, its insecure as hell and has a ton of bugs.
After you have updated tomcat to the latest stable 9.0.62 try rerunning the code.
Additionally you may want to move from Ubuntu to Debian, as Ubuntu is built off Debian’s beta ring. For stability and ultra long stable security updates, Debian is known for this. Ubuntu, even their LTSC items break on update. In Debian you update the apt repos , clear your apt-cache and then do another apt update and apt upgrade respectively.
I would look at the raw images and see if they are being uploaded with windows meta data.
There is a windows attribute for images that includes orientation. On windows this works in some programs, but on linux and anything else that doesn’t understand the meta data, it doesn’t work as the image is correctly scanned (wrong orientation) but the person used Photo viewer bundled with windows 10 to correct the orientation on their windows pc.
There is a couple of solutions for this, as its a common issue.
Thank you so much Zackster, the upgrades did it
I was able to solve the problem. After I upgraded Lucee to version 5.3.9.133 and the Image Extension to 1.2.0.0 Snapshot, all previously incorrectly recognized photos were recognized in the correct orientation.
I use the following configuration in my production environment:
OS: Debian 11.03
Java version: 17.0.3
Tomcat version: 9.0.43
Lucee version: 5.3.9.133
Image Extension 1.2.0.0 Snapshot