Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfimage org.apache.sanselan.ImageWriteException

Explorer ,
Oct 07, 2019 Oct 07, 2019

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)

1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 08, 2019 Oct 08, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

I have a bug filed with Adobe, but I'm not holding my breath for any response:

 

https://tracker.adobe.com/#/view/CF-4205377

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 04, 2020 Jun 04, 2020

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,

 

^ _ ^

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 04, 2020 Jun 04, 2020

Did you ever resolve the cause of this issue?  I'm currently experiencing it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2020 Jun 08, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2020 Aug 17, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 11, 2021 Nov 11, 2021

I get this all the time, have never been able to figure it out or stop it from happening...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 14, 2021 Nov 14, 2021

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 20, 2022 Apr 20, 2022

I am seeing this now as well. cf2018

 

"Tag (-1 (0xffffffff: Unknown Tag): ) appears twice in directory."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 20, 2022 Apr 20, 2022

It still happens in CF2021, too. We've never found out why. Doesn't seem to break anything.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 24, 2022 Oct 24, 2022

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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2022 Oct 24, 2022
LATEST

Wow, thanks! We will try this!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources