You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "VVD (Created) (JIRA)" <ji...@apache.org> on 2012/04/09 21:33:20 UTC

[jira] [Created] (SANSELAN-72) Incorrect reading TIFF file

Incorrect reading TIFF file
---------------------------

                 Key: SANSELAN-72
                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
             Project: Commons Sanselan
          Issue Type: Bug
          Components: Format: PNG, Format: TIFF
    Affects Versions: 1.x
            Reporter: VVD


I found 2 bugs.

I have tif file in.tif.

1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
{code}
Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
{code}

gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
For example 1st line at ~860 points from top and in full width of picture.

2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
{code}$ convert in.tif in.png{code}
{code}
Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
{code}

gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.


I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-72) Incorrect reading TIFF file

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252201#comment-13252201 ] 

Damjan Jovanovic commented on SANSELAN-72:
------------------------------------------

TIFF fields as seen by Sanselan:

	Root:  (tiffImageData)
		New Subfile Type: 0
		Image Width: 2481
		Image Length: 3509
		Bits Per Sample: 1
		Compression: 5
		Photometric Interpretation: 0
		Preview Image Start: 26402, 38118, 64494, 83426, 91444
		Orientation: 1
		Samples Per Pixel: 1
		Rows Per Strip: 842
		Preview Image Length: 11715, 26375, 18932, 8017, 2434
		XResolution: 1181102/10000 (118.11)
		YResolution: 1181102/10000 (118.11)
		Resolution Unit: 3
		Software: 'Adobe Photoshop CS3 Windows'
		Date Time: '2011:04:12 17:12:48'
		XMP: 60, 63, 120, 112, 97, 99, 107, 101, 116, 32, 98, 101, 103, 105, 110, 61, 34, -17, -69, -65, 34, 32, 105, 100, 61, 34, 87, 53, 77, 48, 77, 112, 67, 101, 104, 105, 72, 122, 114, 101, 83, 122, 78, 84, 99, 122, 107, 99, 57, 100, 34... (14990)
		Photoshop Settings: 56, 66, 73, 77, 4, 37, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 66, 73, 77, 4, 47, 0, 0, 0, 0, 0, 74, 2, 0, 1, 0, 72, 0, 0, 0, 72, 0, 0... (11066)
		Exif Offset: 93880

	Exif: 
		Color Space: -1
		Exif Image Width: 2481
		Exif Image Length: 3509

Summary:
BitsPerSample=1 and SamplesPerPixel=1 so it's black and white.
Compression=5 (LZW). This is unsupported by baseline TIFF, but Sanselan should support it.
PhotometricInterpretation=0 (White is zero).
RowsPerStrip=842, which is exactly where the black lines appear.

Now what's causing the black lines, broken LZW decompression or the tiling of the decompressed strips?

                
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (SANSELAN-72) Incorrect reading TIFF file

Posted by "VVD (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250099#comment-13250099 ] 

VVD edited comment on SANSELAN-72 at 4/9/12 7:35 PM:
-----------------------------------------------------

Files from description of this issue.
                
      was (Author: vvd):
    Files from descrition.
                  
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-72) Incorrect reading TIFF file

Posted by "VVD (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254446#comment-13254446 ] 

VVD commented on SANSELAN-72:
-----------------------------

Tested - both fixed now!

Thanks!
                
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>             Fix For: 1.0
>
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-72) Incorrect reading TIFF file

Posted by "VVD (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

VVD updated SANSELAN-72:
------------------------

    Attachment: out-tif.png
                out-png-IM.png
                in.tif
                in.png

Files from descrition.
                
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-72) Incorrect reading TIFF file

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252662#comment-13252662 ] 

Damjan Jovanovic commented on SANSELAN-72:
------------------------------------------

Looks like LZW decompression: the strips coming out of the decompressor have a black line at the bottom.

                
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SANSELAN-72) Incorrect reading TIFF file

Posted by "Damjan Jovanovic (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damjan Jovanovic resolved SANSELAN-72.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

The problem with the grey background was that Sanselan was using the worst possible algorithm described in Section 9.1 of the PNG spec. I've changed it to use the best one as of commit 1325915.

Both issues are now gone -> resolving fixed.

                
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>             Fix For: 1.0
>
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-72) Incorrect reading TIFF file

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253524#comment-13253524 ] 

Damjan Jovanovic commented on SANSELAN-72:
------------------------------------------

It wasn't LZW compression, but calculation of the expected size for decompressed data.
Fixed by commit 1325834 in the latest SVN.

The grey background is still a problem.

                
> Incorrect reading TIFF file
> ---------------------------
>
>                 Key: SANSELAN-72
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-72
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.x
>            Reporter: VVD
>         Attachments: in.png, in.tif, out-png-IM.png, out-tif.png
>
>
> I found 2 bugs.
> I have tif file in.tif.
> 1. After convert it to png (bmp, tga, etc) by Sanselan it getting horizontal lines.
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.tif")), new File("out-tif.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.tif without lines and out.png with lines.
> For example 1st line at ~860 points from top and in full width of picture.
> 2. After convert it to png by convert utility from ImageMagic, and then convert it to png (bmp, tga, etc) by Sanselan it became "gray" - all white pixels become gray.
> {code}$ convert in.tif in.png{code}
> {code}
> Sanselan.writeImage(Sanselan.getBufferedImage(new File("in.png")), new File("out-png-IM.png"), ImageFormat.IMAGE_FORMAT_PNG, null);
> {code}
> gwenview, eog, kolourpaint, gimp, etc show in.png as black and white, but out-png-IM.png as black and gray.
> I'll attach all 4 files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira