[jira] [Commented] (IMAGING-281) Simple Exif XPTitle corrupted.

2021-02-19 Thread Bruno P. Kinoshita (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287588#comment-17287588
 ] 

Bruno P. Kinoshita commented on IMAGING-281:


Thanks for posting the solution for this issue [~garretwilson] . And for 
updating this ticket as well :)

> Simple Exif XPTitle corrupted.
> --
>
> Key: IMAGING-281
> URL: https://issues.apache.org/jira/browse/IMAGING-281
> Project: Commons Imaging
>  Issue Type: Bug
>Affects Versions: 1.0-alpha2
>Reporter: Garret Wilson
>Priority: Blocker
> Attachments: gate-turret-exif-bad-title.jpg
>
>
> I have a small input JPEG image containing _no metadata sections whatsoever_. 
> I use Apache Commons Imaging 1.0-alpha2 to add two simple Exif {{IFD0}} 
> properties using 
> [{{ExifRewriter().updateExifMetadataLossy()}}|https://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html#updateExifMetadataLossy-org.apache.commons.imaging.common.bytesource.ByteSource-java.io.OutputStream-org.apache.commons.imaging.formats.tiff.write.TiffOutputSet-].
> * {{XPTitle}}  ({{0x9C9B}}): "Gate and Turret"
> * {{Copyright}} ({{33432}}, {{0x8298}}): "Copyright © 2009 Garret Wilson"
> Here is a simplified excerpt of the code:
> {code:java}
> TagInfoAscii EXIF_XP_TITLE_TAG_INFO = new TagInfoAscii("XPTitle", 0x9C9B, -1, 
> TiffDirectoryType.EXIF_DIRECTORY_IFD0); //XPTitle (0x9C9B)
> TagInfoAscii EXIF_COPYRIGHT_TAG_INFO = new TagInfoAscii("Copyright", 0x8298, 
> -1, TiffDirectoryType.EXIF_DIRECTORY_IFD0); //Copyright (33432, 0x8298)
> …
> TiffOutputSet tiffOutputSet = new TiffOutputSet();
> TiffOutputDirectory exifDirectory = tiffOutputSet.getOrCreateRootDirectory();
> exifDirectory.add(EXIF_XP_TITLE_TAG_INFO, "Gate and Turret");
> exifDirectory.add(EXIF_COPYRIGHT_TAG_INFO, "Copyright © 2009 Garret Wilson");
> …
> new ExifRewriter().updateExifMetadataLossy(byteSource, outputStream, 
> tiffOutputSet);
> {code}
> Using [ExifTool|https://exiftool.org/] 12.16 (via 
> [ExifToolGUI|https://exiftool.org/gui/) 5.16.0.0], the {{Copyright}} value is 
> stored correctly but the {{XPTitle}} is stored as "慇整愠摮吠牵敲t". 
> [Metadata++|https://www.logipole.com/metadata++-en.htm] 1.22.14 also shows 
> the same corrupted value.
> This is disheartening, as this is nearly the most simple test case possible.
> (Note that [IrfanView|https://www.irfanview.com/] 4.54 can read the 
> {{XPTitle}} just fine! Nevertheless ExifTool is the gold standard for image 
> metadata reading, and is confirmed by Metadata++. Having an image the 
> metadata of which cannot be read in ExifTool is a show-stopper.)
> I'm will attach the test case image to this ticket.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IMAGING-281) Simple Exif XPTitle corrupted.

2021-02-07 Thread Garret Wilson (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17280594#comment-17280594
 ] 

Garret Wilson commented on IMAGING-281:
---

Note also that, when creating the TIFF output set from scratch, if I use the 
following I cannot pick up the values in 
[metadata-extractor|https://github.com/drewnoakes/metadata-extractor]:

{code:java}
TiffOutputDirectory exifDirectory = tiffOutputSet.getOrCreateExifDirectory()
{code}

Instead I have to use this:

{code:java}
TiffOutputDirectory exifDirectory = tiffOutputSet.getOrCreateRootDirectory()
{code}

Again this doesn't fix the problem. It's some counter-intuitive call I have to 
make to get 
[metadata-extractor|https://github.com/drewnoakes/metadata-extractor] to see 
any values at all.

Apache Commons Imaging is corrupting my image metadata, and its documentation 
is incomplete. I'm stuck.

> Simple Exif XPTitle corrupted.
> --
>
> Key: IMAGING-281
> URL: https://issues.apache.org/jira/browse/IMAGING-281
> Project: Commons Imaging
>  Issue Type: Bug
>Affects Versions: 1.0-alpha2
>Reporter: Garret Wilson
>Priority: Blocker
> Attachments: gate-turret-exif-bad-title.jpg
>
>
> I have a small input JPEG image containing _no metadata sections whatsoever_. 
> I use Apache Commons Imaging 1.0-alpha2 to add two simple Exif {{IFD0}} 
> properties using 
> [{{ExifRewriter().updateExifMetadataLossy()}}|https://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html#updateExifMetadataLossy-org.apache.commons.imaging.common.bytesource.ByteSource-java.io.OutputStream-org.apache.commons.imaging.formats.tiff.write.TiffOutputSet-].
> * {{XPTitle}}  ({{0x9C9B}}): "Gate and Turret"
> * {{Copyright}} ({{33432}}, {{0x8298}}): "Copyright © 2009 Garret Wilson"
> Here is a simplified excerpt of the code:
> {code:java}
> TagInfoAscii EXIF_XP_TITLE_TAG_INFO = new TagInfoAscii("XPTitle", 0x9C9B, -1, 
> TiffDirectoryType.EXIF_DIRECTORY_IFD0); //XPTitle (0x9C9B)
> TagInfoAscii EXIF_COPYRIGHT_TAG_INFO = new TagInfoAscii("Copyright", 0x8298, 
> -1, TiffDirectoryType.EXIF_DIRECTORY_IFD0); //Copyright (33432, 0x8298)
> …
> TiffOutputSet tiffOutputSet = new TiffOutputSet();
> TiffOutputDirectory exifDirectory = tiffOutputSet.getOrCreateRootDirectory();
> exifDirectory.add(EXIF_XP_TITLE_TAG_INFO, "Gate and Turret");
> exifDirectory.add(EXIF_COPYRIGHT_TAG_INFO, "Copyright © 2009 Garret Wilson");
> …
> new ExifRewriter().updateExifMetadataLossy(byteSource, outputStream, 
> tiffOutputSet);
> {code}
> Using [ExifTool|https://exiftool.org/] 12.16 (via 
> [ExifToolGUI|https://exiftool.org/gui/) 5.16.0.0], the {{Copyright}} value is 
> stored correctly but the {{XPTitle}} is stored as "慇整愠摮吠牵敲t". 
> [Metadata++|https://www.logipole.com/metadata++-en.htm] 1.22.14 also shows 
> the same corrupted value.
> This is disheartening, as this is nearly the most simple test case possible.
> (Note that [IrfanView|https://www.irfanview.com/] 4.54 can read the 
> {{XPTitle}} just fine! Nevertheless ExifTool is the gold standard for image 
> metadata reading, and is confirmed by Metadata++. Having an image the 
> metadata of which cannot be read in ExifTool is a show-stopper.)
> I'm will attach the test case image to this ticket.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IMAGING-281) Simple Exif XPTitle corrupted.

2021-02-07 Thread Garret Wilson (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17280590#comment-17280590
 ] 

Garret Wilson commented on IMAGING-281:
---

If I use the same code with the {{ImageDescription}} field, it seems to work:

{code:java}
TagInfoAscii EXIF_IMAGE_DESCRIPTION_TAG_INFO = new 
TagInfoAscii("ImageDescription", 0x010E, -1, 
TiffDirectoryType.EXIF_DIRECTORY_IFD0); //ImageDescription (270, 0x010E)
{code}

Note that this doesn't fix the problem. I want to write the {{XPTitle}} field. 
Moreover not knowing what the problem is, I don't know if Apache Common Imaging 
is going to arbitrarily corrupt some of my Exif fields, and when.

> Simple Exif XPTitle corrupted.
> --
>
> Key: IMAGING-281
> URL: https://issues.apache.org/jira/browse/IMAGING-281
> Project: Commons Imaging
>  Issue Type: Bug
>Affects Versions: 1.0-alpha2
>Reporter: Garret Wilson
>Priority: Blocker
> Attachments: gate-turret-exif-bad-title.jpg
>
>
> I have a small input JPEG image containing _no metadata sections whatsoever_. 
> I use Apache Commons Imaging 1.0-alpha2 to add two simple Exif {{IFD0}} 
> properties using 
> [{{ExifRewriter().updateExifMetadataLossy()}}|https://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html#updateExifMetadataLossy-org.apache.commons.imaging.common.bytesource.ByteSource-java.io.OutputStream-org.apache.commons.imaging.formats.tiff.write.TiffOutputSet-].
> * {{XPTitle}}  ({{0x9C9B}}): "Gate and Turret"
> * {{Copyright}} ({{33432}}, {{0x8298}}): "Copyright © 2009 Garret Wilson"
> Here is a simplified excerpt of the code:
> {code:java}
> TagInfoAscii EXIF_XP_TITLE_TAG_INFO = new TagInfoAscii("XPTitle", 0x9C9B, -1, 
> TiffDirectoryType.EXIF_DIRECTORY_IFD0); //XPTitle (0x9C9B)
> TagInfoAscii EXIF_COPYRIGHT_TAG_INFO = new TagInfoAscii("Copyright", 0x8298, 
> -1, TiffDirectoryType.EXIF_DIRECTORY_IFD0); //Copyright (33432, 0x8298)
> …
> TiffOutputSet tiffOutputSet = new TiffOutputSet();
> TiffOutputDirectory exifDirectory = tiffOutputSet.getOrCreateRootDirectory();
> exifDirectory.add(EXIF_XP_TITLE_TAG_INFO, "Gate and Turret");
> exifDirectory.add(EXIF_COPYRIGHT_TAG_INFO, "Copyright © 2009 Garret Wilson");
> …
> new ExifRewriter().updateExifMetadataLossy(byteSource, outputStream, 
> tiffOutputSet);
> {code}
> Using [ExifTool|https://exiftool.org/] 12.16 (via 
> [ExifToolGUI|https://exiftool.org/gui/) 5.16.0.0], the {{Copyright}} value is 
> stored correctly but the {{XPTitle}} is stored as "慇整愠摮吠牵敲t". 
> [Metadata++|https://www.logipole.com/metadata++-en.htm] 1.22.14 also shows 
> the same corrupted value.
> This is disheartening, as this is nearly the most simple test case possible.
> (Note that [IrfanView|https://www.irfanview.com/] 4.54 can read the 
> {{XPTitle}} just fine! Nevertheless ExifTool is the gold standard for image 
> metadata reading, and is confirmed by Metadata++. Having an image the 
> metadata of which cannot be read in ExifTool is a show-stopper.)
> I'm will attach the test case image to this ticket.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)