Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 526

ImageInfo() on certain files causes exceptions in the log, but not on the page

$
0
0

We’re getting a number of apache imaging exceptions written to our application.log files. This happens when user(s) upload a less-than-valid image file which ends up getting run through imageInfo().

<cfset foo = imageInfo(imageRead("./badImage.jpg"))/>

I tried attaching one of the bad images to this post, but it gets resized so I don’t know if it will still be bad. I have uploaded the raw image file here: 43459A.jpg - Google Drive

The page does not throw any exceptions; the user is not affected. But this exception does clutter up the log. Can something be done to silence this exception? I think the problem is happening in the Apache imaging library, from the Lucee image extension.

Line 46 here: https://github.com/apache/sanselan/blob/trunk/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceArray.java

Line 402 here:

Maybe the throw on line 405 should have an if around it? Only throw the exception if it’s something other than this exception that the Apache Commons Imaging library is known to throw?

I’m still confused as to why the exception doesn’t bubble up to the page. Maybe because someone on the Lucee team already tried to work on this?

FYI the result from ImageInfo() appears correct, even with the bad image.

Window: Windows
Java Version: 11.0.21
Tomcat Version: 9.0.83
Lucee Version: I’ve tried 5.3.12.1 and 5.4.4.38

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 526

Trending Articles