Copy link to clipboard
Copied
I loop through a directory and resize images using the cfimage tag. When I inspect exception.log, I see a bunch of expections. The tag appears to be working though.
"Error","ajp-nio-8018-exec-4","10/08/19","05:33:31","","Tag (-1 (0xffffffff: Unknown Tag): ) appears twice in directory."
org.apache.sanselan.ImageWriteException: Tag (-1 (0xffffffff: Unknown Tag): ) appears twice in directory.
at org.apache.sanselan.formats.tiff.write.TiffImageWriterBase.validateDirectories(TiffImageWriterBase.java:135)
at org.apache.sanselan.formats.tiff.write.TiffImageWriterLossless.write(TiffImageWriterLossless.java:237)
at org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter.writeExifSegment(ExifRewriter.java:573)
at org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter.updateExifMetadataLossless(ExifRewriter.java:382)
at org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter.updateExifMetadataLossless(ExifRewriter.java:298)
at coldfusion.image.ExifMetaDataHelper$1.run(ExifMetaDataHelper.java:100)
at coldfusion.image.ExifMetaDataHelper$1.run(ExifMetaDataHelper.java:87)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at coldfusion.image.ExifMetaDataHelper.copyExifMetadata(ExifMetaDataHelper.java:86)
at coldfusion.image.ImageWriter.writeImage(ImageWriter.java:356)
at coldfusion.image.ImageWriter.writeImage(ImageWriter.java:199)
at coldfusion.image.Image.write(Image.java:940)
at coldfusion.tagext.io.ImageTag.performWrite(ImageTag.java:681)
at coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:457)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:4286)
Copy link to clipboard
Copied
I also see the exact same errors in the exception.log. It appears to have started when we updated from CF2016 Update 7 to Update 9. As you say, the code appears to be working, but these exceptions are worrying.
Copy link to clipboard
Copied
Same. I've been trying to resolve this with Adobe Support since April. Still a work in progress. Strangely it doesn't happen (anymore) in all of our environments. Sure does dirty up the exception log.
Copy link to clipboard
Copied
I have a bug filed with Adobe, but I'm not holding my breath for any response:
Copy link to clipboard
Copied
Are you sure that the link you provided is the correct one? I clicked on it and it is for a bug related to CFLDAP, not image resizing.
V/r,
^ _ ^
Copy link to clipboard
Copied
Did you ever resolve the cause of this issue? I'm currently experiencing it.
Copy link to clipboard
Copied
No, never did. They sent me a patch that was supposed to fix it, but it didn't. It only happens in certain environments (production!), too, which makes it harder to troubleshoot.
I'm hoping when we migrate from CF2016 to 2020 it will be resolved.
Copy link to clipboard
Copied
I am experiencing this error as well, I check on my server and it doe snot appear that the img is actually being created in the directory. My code workds sometimes but not always I am suspecting that it depends on the specific file or content.
Copy link to clipboard
Copied
I get this all the time, have never been able to figure it out or stop it from happening...
Copy link to clipboard
Copied
The only ticket I could find on ImageWriteException is https://tracker.adobe.com/#/view/CF-4209962 .
It was closed because Adobe was unable to reproduce the issue.
Copy link to clipboard
Copied
I am seeing this now as well. cf2018
"Tag (-1 (0xffffffff: Unknown Tag): ) appears twice in directory."
Copy link to clipboard
Copied
It still happens in CF2021, too. We've never found out why. Doesn't seem to break anything.
Copy link to clipboard
Copied
I think I've finally stumbled over the cause of this:
org.apache.commons.imaging.ImageWriteException: Missing root directory
This triggers the error:
<cfimage action="writeToBrowser" source="c:/whatevver" format="jpg" WIDTH=400 quality=".25">
This works fine:
<cfimage action="writeToBrowser" source="c:/whatevver" format="png" WIDTH=400 quality=".25">
So it seems for whatever reason it's having issues trying to compress the jpg (?). Switching to PNG fixed it for me (as did removing the quality variable altogether)
Copy link to clipboard
Copied
Wow, thanks! We will try this!