[jira] [Work logged] (IMAGING-319) updateExifMetadataLossless lost the first character of a String

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IMAGING-319?focusedWorklogId=751300=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751300
 ]

ASF GitHub Bot logged work on IMAGING-319:
--

Author: ASF GitHub Bot
Created on: 31/Mar/22 23:52
Start Date: 31/Mar/22 23:52
Worklog Time Spent: 10m 
  Work Description: gwlucastrig closed pull request #203:
URL: https://github.com/apache/commons-imaging/pull/203


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751300)
Time Spent: 40m  (was: 0.5h)

> updateExifMetadataLossless lost the first character of a String
> ---
>
> Key: IMAGING-319
> URL: https://issues.apache.org/jira/browse/IMAGING-319
> Project: Commons Imaging
>  Issue Type: Bug
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha2
>Reporter: Sicheng Yang
>Assignee: Bruno P. Kinoshita
>Priority: Major
> Attachments: Screen Shot 2021-11-26 at 4.01.06 PM-1.png, Screen Shot 
> 2021-11-26 at 4.01.21 PM-1.png, iPhone12-geotag.JPG
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> I try to use TiffOutputSet to generate a new image. However, if a tag that 
> contains String, the program may miss the first character of the String.
>  
> import java.io.*;
> import org.apache.commons.imaging.ImageReadException;
> import org.apache.commons.imaging.ImageWriteException;
> import org.apache.commons.imaging.Imaging;
> import org.apache.commons.imaging.common.ImageMetadata;
> import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata;
> import org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter;
> import org.apache.commons.imaging.formats.tiff.TiffImageMetadata;
> import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
> public class LibraryTest {
>     public static void main(String[] args) throws ImageReadException, 
> IOException, ImageWriteException {
>         File source = new File("./assets/iPhone12-geotag.JPG");
>         File result = new 
> File("./assets/results/editted-iPhone12-geotag.JPG");
>         final ImageMetadata metadata = Imaging.getMetadata(source);
>         final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
>         final TiffImageMetadata exif = jpegMetadata.getExif();
>         TiffOutputSet outputSet = exif.getOutputSet();
>         BufferedOutputStream bufferedOutputStream = new 
> BufferedOutputStream(new FileOutputStream(result));
>         new ExifRewriter().updateExifMetadataLossless(source, 
> bufferedOutputStream, outputSet);
>     }
> }
>  
> This is the sample code.
> Tag value in original image
> !image-2021-11-26-16-01-58-645.png!
> Tag value in output image
> !image-2021-11-26-16-04-12-185.png!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Work logged] (IMAGING-319) updateExifMetadataLossless lost the first character of a String

2022-03-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IMAGING-319?focusedWorklogId=737051=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-737051
 ]

ASF GitHub Bot logged work on IMAGING-319:
--

Author: ASF GitHub Bot
Created on: 05/Mar/22 09:05
Start Date: 05/Mar/22 09:05
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #203:
URL: https://github.com/apache/commons-imaging/pull/203#issuecomment-1059725853


   That was quite the detective work @gwlucastrig :clap: The change is really 
small, but I couldn't understand just reading the code. Going to have to 
re-read the JIRA and your description here :nerd_face: but it's looking good! 
Thanks Gary!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 737051)
Time Spent: 0.5h  (was: 20m)

> updateExifMetadataLossless lost the first character of a String
> ---
>
> Key: IMAGING-319
> URL: https://issues.apache.org/jira/browse/IMAGING-319
> Project: Commons Imaging
>  Issue Type: Bug
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha2
>Reporter: Sicheng Yang
>Assignee: Bruno P. Kinoshita
>Priority: Major
> Attachments: Screen Shot 2021-11-26 at 4.01.06 PM-1.png, Screen Shot 
> 2021-11-26 at 4.01.21 PM-1.png, iPhone12-geotag.JPG
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> I try to use TiffOutputSet to generate a new image. However, if a tag that 
> contains String, the program may miss the first character of the String.
>  
> import java.io.*;
> import org.apache.commons.imaging.ImageReadException;
> import org.apache.commons.imaging.ImageWriteException;
> import org.apache.commons.imaging.Imaging;
> import org.apache.commons.imaging.common.ImageMetadata;
> import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata;
> import org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter;
> import org.apache.commons.imaging.formats.tiff.TiffImageMetadata;
> import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
> public class LibraryTest {
>     public static void main(String[] args) throws ImageReadException, 
> IOException, ImageWriteException {
>         File source = new File("./assets/iPhone12-geotag.JPG");
>         File result = new 
> File("./assets/results/editted-iPhone12-geotag.JPG");
>         final ImageMetadata metadata = Imaging.getMetadata(source);
>         final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
>         final TiffImageMetadata exif = jpegMetadata.getExif();
>         TiffOutputSet outputSet = exif.getOutputSet();
>         BufferedOutputStream bufferedOutputStream = new 
> BufferedOutputStream(new FileOutputStream(result));
>         new ExifRewriter().updateExifMetadataLossless(source, 
> bufferedOutputStream, outputSet);
>     }
> }
>  
> This is the sample code.
> Tag value in original image
> !image-2021-11-26-16-01-58-645.png!
> Tag value in output image
> !image-2021-11-26-16-04-12-185.png!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Work logged] (IMAGING-319) updateExifMetadataLossless lost the first character of a String

2022-02-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IMAGING-319?focusedWorklogId=726031=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-726031
 ]

ASF GitHub Bot logged work on IMAGING-319:
--

Author: ASF GitHub Bot
Created on: 14/Feb/22 02:36
Start Date: 14/Feb/22 02:36
Worklog Time Spent: 10m 
  Work Description: gwlucastrig opened a new pull request #203:
URL: https://github.com/apache/commons-imaging/pull/203


   I added comments to the JIRA ticket on this item at 
[IMAGING-319](https://issues.apache.org/jira/browse/IMAGING-319)
   
   Unfortunately, it will be hard for me to create a JUnit test to specifically 
test this change without actually adding the user's original file (which is 
large) to our code distribution. 
   
   The following text shows the problem.  
   The users' test program read the data and then re-wrote it using the Commons 
Imaging library.  In the code below, his original File variable is named 
"source" and the rewritten version is named "result".

   
   ImageMetadata metadata2 = Imaging.getMetadata(source);  // or result
   JpegImageMetadata jpegMetadata2 = (JpegImageMetadata) metadata2;
   TiffImageMetadata exif2 = jpegMetadata2.getExif();
   String s2 = exif2.toString();
   System.out.println("\n" + s2 + "\n");
   
   The printout for the original EXIF block (with many elements removed) comes 
up as:
   Exif: 
   ExifVersion: 48, 50, 51, 50
   DateTimeOriginal: '2021:10:28 13:47:07'
   DateTimeDigitized: '2021:10:28 13:47:07'
   Unknown Tag (0x9010): '-05:00'
   Unknown Tag (0x9011): '-05:00'
   Unknown Tag (0x9012): '-05:00'
   
   Unknown tag 0x9010 is fine.  But if you perform the same thing on this 
result, it comes up with the first character in Tag 0x9010 as a comma rather 
than a negative sign as shown below:
   
   Exif: 
   Unknown Tag (0x9010): , 05:00
   Unknown Tag (0x9011): '-05:00'
   Unknown Tag (0x9012): '-05:00'
   
   The attached fix repairs the problem and causes the EXIF tag to be printed 
correctly.
   
   Here's the full code for the test program:
   
   import java.io.BufferedOutputStream;
   import java.io.File;
   import java.io.FileOutputStream;
   import java.io.IOException;
   import org.apache.commons.imaging.ImageReadException;
   import org.apache.commons.imaging.ImageWriteException;
   import org.apache.commons.imaging.Imaging;
   import org.apache.commons.imaging.common.ImageMetadata;
   import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata;
   import org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter;
   import org.apache.commons.imaging.formats.tiff.TiffImageMetadata;
   import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
   

   public class CommonsIssue319 {
   
 public static void main(String[] args) throws ImageReadException, 
IOException, ImageWriteException {
   File source = new File("iPhone12-geotag.JPG");
   File result = new File("editted-iPhone12-geotag.JPG");
   final ImageMetadata metadata = Imaging.getMetadata(source);
   final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
   final TiffImageMetadata exif = jpegMetadata.getExif();
   String s = exif.toString();
   System.out.println("\n" + s + "\n");
   TiffOutputSet outputSet = exif.getOutputSet();
   BufferedOutputStream bufferedOutputStream = new 
   BufferedOutputStream(new FileOutputStream(result));
   new ExifRewriter().updateExifMetadataLossless(source, 
   bufferedOutputStream, outputSet);
   bufferedOutputStream.flush();
   bufferedOutputStream.close();
   
   ImageMetadata metadata2 = Imaging.getMetadata(result);
   JpegImageMetadata jpegMetadata2 = (JpegImageMetadata) metadata2;
   TiffImageMetadata exif2 = jpegMetadata2.getExif();
   String s2 = exif2.toString();
   System.out.println("\n" + s2 + "\n");
 }
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 726031)
Time Spent: 20m  (was: 10m)

> updateExifMetadataLossless lost the first character of a String
> ---
>
> Key: IMAGING-319
> URL: https://issues.apache.org/jira/browse/IMAGING-319
> Project: Commons Imaging
>  Issue Type: Bug
>  Components: Format: JPEG
>

[jira] [Work logged] (IMAGING-319) updateExifMetadataLossless lost the first character of a String

2022-02-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IMAGING-319?focusedWorklogId=725801=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-725801
 ]

ASF GitHub Bot logged work on IMAGING-319:
--

Author: ASF GitHub Bot
Created on: 13/Feb/22 14:12
Start Date: 13/Feb/22 14:12
Worklog Time Spent: 10m 
  Work Description: gwlucastrig opened a new pull request #203:
URL: https://github.com/apache/commons-imaging/pull/203


   I added comments to the JIRA ticket on this item at 
[IMAGING-319](https://issues.apache.org/jira/browse/IMAGING-319)
   
   Unfortunately, it will be hard for me to create a JUnit test to specifically 
test this change without actually adding the user's original file (which is 
large) to our code distribution. 
   
   The following text shows the problem.  
   The users' test program read the data and then re-wrote it using the Commons 
Imaging library.  In the code below, his original File variable is named 
"source" and the rewritten version is named "result".

   
   ImageMetadata metadata2 = Imaging.getMetadata(source);  // or result
   JpegImageMetadata jpegMetadata2 = (JpegImageMetadata) metadata2;
   TiffImageMetadata exif2 = jpegMetadata2.getExif();
   String s2 = exif2.toString();
   System.out.println("\n" + s2 + "\n");
   
   The printout for the original EXIF block (with many elements removed) comes 
up as:
   Exif: 
   ExifVersion: 48, 50, 51, 50
   DateTimeOriginal: '2021:10:28 13:47:07'
   DateTimeDigitized: '2021:10:28 13:47:07'
   Unknown Tag (0x9010): '-05:00'
   Unknown Tag (0x9011): '-05:00'
   Unknown Tag (0x9012): '-05:00'
   
   Unknown tag 0x9010 is fine.  But if you perform the same thing on this 
result, it comes up with the first character in Tag 0x9010 as a comma rather 
than a negative sign as shown below:
   
   Exif: 
   Unknown Tag (0x9010): , 05:00
   Unknown Tag (0x9011): '-05:00'
   Unknown Tag (0x9012): '-05:00'
   
   The attached fix repairs the problem and causes the EXIF tag to be printed 
correctly.
   
   Here's the full code for the test program:
   
   import java.io.BufferedOutputStream;
   import java.io.File;
   import java.io.FileOutputStream;
   import java.io.IOException;
   import org.apache.commons.imaging.ImageReadException;
   import org.apache.commons.imaging.ImageWriteException;
   import org.apache.commons.imaging.Imaging;
   import org.apache.commons.imaging.common.ImageMetadata;
   import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata;
   import org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter;
   import org.apache.commons.imaging.formats.tiff.TiffImageMetadata;
   import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
   

   public class CommonsIssue319 {
   
 public static void main(String[] args) throws ImageReadException, 
IOException, ImageWriteException {
   File source = new File("iPhone12-geotag.JPG");
   File result = new File("editted-iPhone12-geotag.JPG");
   final ImageMetadata metadata = Imaging.getMetadata(source);
   final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
   final TiffImageMetadata exif = jpegMetadata.getExif();
   String s = exif.toString();
   System.out.println("\n" + s + "\n");
   TiffOutputSet outputSet = exif.getOutputSet();
   BufferedOutputStream bufferedOutputStream = new 
   BufferedOutputStream(new FileOutputStream(result));
   new ExifRewriter().updateExifMetadataLossless(source, 
   bufferedOutputStream, outputSet);
   bufferedOutputStream.flush();
   bufferedOutputStream.close();
   
   ImageMetadata metadata2 = Imaging.getMetadata(result);
   JpegImageMetadata jpegMetadata2 = (JpegImageMetadata) metadata2;
   TiffImageMetadata exif2 = jpegMetadata2.getExif();
   String s2 = exif2.toString();
   System.out.println("\n" + s2 + "\n");
 }
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 725801)
Remaining Estimate: 0h
Time Spent: 10m

> updateExifMetadataLossless lost the first character of a String
> ---
>
> Key: IMAGING-319
> URL: https://issues.apache.org/jira/browse/IMAGING-319
> Project: Commons Imaging
>  Issue Type: Bug
>