Isimagefile with strange flaky behaviour

I’m fighting with the isimagefile. It worked several times but now, out of the sudden it gives me back false without changing the code.

So:

writeDump(isimagefile("https://avatars1.githubusercontent.com/u/10973141?s=280&v=4"));
gives back true.

If i save exactly that image on my server, it turns to false, no matter what kind of path i use .

Also all the saved images with

<cffile action="upload" fileField="image" destination="#thisDir#" result="fileUpload" mode="777"
                nameconflict="overwrite">

gives back a false.

I checked permissions, logs etc. but found nothing, it must be something with my local server but what?

thxs for hints where to aim for the troubleshooting

PS: i updated the image extension up to the newest snapshot.

OS: Ubuntu 20 something
Java Version: ???
Tomcat Version: ???
Lucee Version: ???

I found out i have a path problem.
Is there a way to set a debug flag?
With <cfsetting showDebugOutput="Yes">brings infos out the size of abook but nothing specific.

1 Like

What specific information are you looking during debugging for?

Just using isImage() is way to little for file checking, it will discard any possible error silently and return false. I think that’s how it was designed to work.

I’d say, before doing any kind of file reading and manipulation (that includes isImage())), do several checks before, like fileexists, and also cflock them and possibly embrace them with cftry/cfcatch to get more detailed error information.

For even more detailed image information, I’d use imagemagick, it will give you powerfull information about any image file.

1 Like