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">
<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?
Don’t forget to tell us about your stack!
OS: Ubuntu 20.04
Java Version: 17.0.3
Tomcat Version: 9.0.31
Lucee Version: 126.96.36.199