You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Niklas (Jira)" <ji...@apache.org> on 2021/01/01 13:41:00 UTC

[jira] [Created] (IMAGING-274) Corrupted TIFF output

Niklas created IMAGING-274:
------------------------------

             Summary: Corrupted TIFF output
                 Key: IMAGING-274
                 URL: https://issues.apache.org/jira/browse/IMAGING-274
             Project: Commons Imaging
          Issue Type: Bug
          Components: Format: TIFF
    Affects Versions: 1.0-alpha2, 1.0-alpha1
            Reporter: Niklas
         Attachments: 20171029_171217 - 20171029_171223-gps-corrupted.tif, 20171029_171217 - 20171029_171223-original.tif

I'm attempting to update GPS data in JPEG and TIFF files. The following example results in corrupted TIFF files while working perfectly fine for JPEG:
{code:java}
		try (BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(dst))) {
			if (metadata instanceof JpegImageMetadata) {
				new ExifRewriter().updateExifMetadataLossless(imageFile, os, outputSet);
			} else if (metadata instanceof TiffImageMetadata) {
				new TiffImageWriterLossless(FileUtils.readFileToByteArray(imageFile)).write(os, outputSet);
			}
		}
{code}
I attached both the original and the updated (corrupted) TIFF file with GPS data. Some software (e.g. Windows Photos) is able to show the images with black stripes, other software (including javax.ImageIO) is unable to read them at all.

And even though not exactly related to this issue: It would be really awesome to have a similar ExifRewriter function for TIFF files!



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