Skip to main content
kenc66324322
Inspiring
October 8, 2019
Question

cfimage org.apache.sanselan.ImageWriteException

  • October 8, 2019
  • 6 replies
  • 2198 views

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)

    This topic has been closed for replies.

    6 replies

    Known Participant
    April 20, 2022

    I am seeing this now as well. cf2018

     

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

    Participant
    April 20, 2022

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

    tonym64063353
    Inspiring
    October 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)

    tonym64063353
    Inspiring
    November 11, 2021

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

    BKBK
    Community Expert
    Community Expert
    November 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.

    powertoast
    Participating Frequently
    August 18, 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.

    Inspiring
    June 4, 2020

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

    Participant
    June 8, 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.

    Participant
    October 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.

    Inspiring
    October 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

    WolfShade
    Legend
    June 4, 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,

     

    ^ _ ^

    Inspiring
    October 9, 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.