[jira] [Created] (SANSELAN-64) Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (SANSELAN-64) Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"

Richard (Jira)
Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"
------------------------------------------------------------------

                 Key: SANSELAN-64
                 URL: https://issues.apache.org/jira/browse/SANSELAN-64
             Project: Commons Sanselan
          Issue Type: Bug
          Components: Format: TIFF
    Affects Versions: 0.97
         Environment: Any
            Reporter: VVD


{code:title=Test.java|borderStyle=solid}
package test;
import ...;
public class Test {
        public static void main (String[] args) {
                File fin = new File("/file.tif");
                File fout = new File("/file.png");
                try {
                        Map params = new Hashtable();
                        BufferedImage image = Sanselan.getBufferedImage(fin);
                        Sanselan.writeImage(image, fout, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}
{code}
org.apache.sanselan.ImageReadException: Missing expected field: 277 (0x115: Samples Per Pixel):
        at org.apache.sanselan.formats.tiff.TiffDirectory.findField(TiffDirectory.java:186)
        at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:463)
        at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
        at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
        at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
        at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1231)
        at test.Test.main(Test.java:24)

24 is line: "BufferedImage image = Sanselan.getBufferedImage(fin);"

I look at sources and see that TIFF_TAG_SAMPLES_PER_PIXEL is mandatory tag:
"int samplesPerPixel = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL, *true*).getIntValue();"
Why?

ImageMagick simple show warning and convert it correctly:
Unknown field with tag 32309 (0x7e35) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
Unknown field with tag 32950 (0x80b6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
KDE applications (gwenview, okular, kolourpaint) show warning and open too:
TIFFReadDirectory: Warning, Unknown field with tag 32309 (0x7e35) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 32950 (0x80b6) encountered.

Do I need to check not released versions (from sources)?

Also TIFF compression 4 isn't supported, but I saw Issue that Sanselat 1.0 is support it, but 1.0 isn't released yet.


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

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SANSELAN-64) Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"

Richard (Jira)

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

Damjan Jovanovic commented on SANSELAN-64:
------------------------------------------

SamplesPerPixel is mandatory for color images, but optional for black and white, grayscale, and palleted. I fixed that particular problem a few months ago in SVN HEAD.

Compression 4 is also working in SVN HEAD, but not well documented, and only works with perfect images. Many CCITT Group 4 compressed images are corrupt in just about every possible way, and real-world TIFF parsers deal with that. It's something I hope to improve before 1.0 is released.

You can try the unreleased version in SVN HEAD, or wait a few weeks for the 1.0 release.

               

> Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"
> ------------------------------------------------------------------
>
>                 Key: SANSELAN-64
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-64
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 0.97
>         Environment: Any
>            Reporter: VVD
>
> {code:title=Test.java|borderStyle=solid}
> package test;
> import ...;
> public class Test {
> public static void main (String[] args) {
> File fin = new File("/file.tif");
> File fout = new File("/file.png");
> try {
> Map params = new Hashtable();
> BufferedImage image = Sanselan.getBufferedImage(fin);
> Sanselan.writeImage(image, fout, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {code}
> org.apache.sanselan.ImageReadException: Missing expected field: 277 (0x115: Samples Per Pixel):
> at org.apache.sanselan.formats.tiff.TiffDirectory.findField(TiffDirectory.java:186)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:463)
> at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1231)
> at test.Test.main(Test.java:24)
> 24 is line: "BufferedImage image = Sanselan.getBufferedImage(fin);"
> I look at sources and see that TIFF_TAG_SAMPLES_PER_PIXEL is mandatory tag:
> "int samplesPerPixel = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL, *true*).getIntValue();"
> Why?
> ImageMagick simple show warning and convert it correctly:
> Unknown field with tag 32309 (0x7e35) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> Unknown field with tag 32950 (0x80b6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> KDE applications (gwenview, okular, kolourpaint) show warning and open too:
> TIFFReadDirectory: Warning, Unknown field with tag 32309 (0x7e35) encountered.
> TIFFReadDirectory: Warning, Unknown field with tag 32950 (0x80b6) encountered.
> Do I need to check not released versions (from sources)?
> Also TIFF compression 4 isn't supported, but I saw Issue that Sanselat 1.0 is support it, but 1.0 isn't released yet.

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

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (SANSELAN-64) Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"

Richard (Jira)
In reply to this post by Richard (Jira)

     [ https://issues.apache.org/jira/browse/SANSELAN-64?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damjan Jovanovic resolved SANSELAN-64.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

All issues, including the one described in the bug title, are already fixed in SVN, so resolving FIXED.

               

> Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"
> ------------------------------------------------------------------
>
>                 Key: SANSELAN-64
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-64
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 0.97
>         Environment: Any
>            Reporter: VVD
>             Fix For: 1.0
>
>
> {code:title=Test.java|borderStyle=solid}
> package test;
> import ...;
> public class Test {
> public static void main (String[] args) {
> File fin = new File("/file.tif");
> File fout = new File("/file.png");
> try {
> Map params = new Hashtable();
> BufferedImage image = Sanselan.getBufferedImage(fin);
> Sanselan.writeImage(image, fout, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {code}
> org.apache.sanselan.ImageReadException: Missing expected field: 277 (0x115: Samples Per Pixel):
> at org.apache.sanselan.formats.tiff.TiffDirectory.findField(TiffDirectory.java:186)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:463)
> at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1231)
> at test.Test.main(Test.java:24)
> 24 is line: "BufferedImage image = Sanselan.getBufferedImage(fin);"
> I look at sources and see that TIFF_TAG_SAMPLES_PER_PIXEL is mandatory tag:
> "int samplesPerPixel = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL, *true*).getIntValue();"
> Why?
> ImageMagick simple show warning and convert it correctly:
> Unknown field with tag 32309 (0x7e35) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> Unknown field with tag 32950 (0x80b6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> KDE applications (gwenview, okular, kolourpaint) show warning and open too:
> TIFFReadDirectory: Warning, Unknown field with tag 32309 (0x7e35) encountered.
> TIFFReadDirectory: Warning, Unknown field with tag 32950 (0x80b6) encountered.
> Do I need to check not released versions (from sources)?
> Also TIFF compression 4 isn't supported, but I saw Issue that Sanselat 1.0 is support it, but 1.0 isn't released yet.

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

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SANSELAN-64) Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"

Richard (Jira)
In reply to this post by Richard (Jira)

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

VVD commented on SANSELAN-64:
-----------------------------

Big thanks!
Is there somewhere in nightly builds of the Sanselan?
If no, I'll get current version from SVN and compile self.
But ready package is better and easier. :-]
               

> Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"
> ------------------------------------------------------------------
>
>                 Key: SANSELAN-64
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-64
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 0.97
>         Environment: Any
>            Reporter: VVD
>             Fix For: 1.0
>
>
> {code:title=Test.java|borderStyle=solid}
> package test;
> import ...;
> public class Test {
> public static void main (String[] args) {
> File fin = new File("/file.tif");
> File fout = new File("/file.png");
> try {
> Map params = new Hashtable();
> BufferedImage image = Sanselan.getBufferedImage(fin);
> Sanselan.writeImage(image, fout, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {code}
> org.apache.sanselan.ImageReadException: Missing expected field: 277 (0x115: Samples Per Pixel):
> at org.apache.sanselan.formats.tiff.TiffDirectory.findField(TiffDirectory.java:186)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:463)
> at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1231)
> at test.Test.main(Test.java:24)
> 24 is line: "BufferedImage image = Sanselan.getBufferedImage(fin);"
> I look at sources and see that TIFF_TAG_SAMPLES_PER_PIXEL is mandatory tag:
> "int samplesPerPixel = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL, *true*).getIntValue();"
> Why?
> ImageMagick simple show warning and convert it correctly:
> Unknown field with tag 32309 (0x7e35) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> Unknown field with tag 32950 (0x80b6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> KDE applications (gwenview, okular, kolourpaint) show warning and open too:
> TIFFReadDirectory: Warning, Unknown field with tag 32309 (0x7e35) encountered.
> TIFFReadDirectory: Warning, Unknown field with tag 32950 (0x80b6) encountered.
> Do I need to check not released versions (from sources)?
> Also TIFF compression 4 isn't supported, but I saw Issue that Sanselat 1.0 is support it, but 1.0 isn't released yet.

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

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SANSELAN-64) Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"

Richard (Jira)
In reply to this post by Richard (Jira)

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

VVD commented on SANSELAN-64:
-----------------------------

I got current version from git and compile it self - my tiff image was opened correctly.

Thanks.
               

> Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel"
> ------------------------------------------------------------------
>
>                 Key: SANSELAN-64
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-64
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 0.97
>         Environment: Any
>            Reporter: VVD
>             Fix For: 1.0
>
>
> {code:title=Test.java|borderStyle=solid}
> package test;
> import ...;
> public class Test {
> public static void main (String[] args) {
> File fin = new File("/file.tif");
> File fout = new File("/file.png");
> try {
> Map params = new Hashtable();
> BufferedImage image = Sanselan.getBufferedImage(fin);
> Sanselan.writeImage(image, fout, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {code}
> org.apache.sanselan.ImageReadException: Missing expected field: 277 (0x115: Samples Per Pixel):
> at org.apache.sanselan.formats.tiff.TiffDirectory.findField(TiffDirectory.java:186)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:463)
> at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1231)
> at test.Test.main(Test.java:24)
> 24 is line: "BufferedImage image = Sanselan.getBufferedImage(fin);"
> I look at sources and see that TIFF_TAG_SAMPLES_PER_PIXEL is mandatory tag:
> "int samplesPerPixel = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL, *true*).getIntValue();"
> Why?
> ImageMagick simple show warning and convert it correctly:
> Unknown field with tag 32309 (0x7e35) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> Unknown field with tag 32950 (0x80b6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> KDE applications (gwenview, okular, kolourpaint) show warning and open too:
> TIFFReadDirectory: Warning, Unknown field with tag 32309 (0x7e35) encountered.
> TIFFReadDirectory: Warning, Unknown field with tag 32950 (0x80b6) encountered.
> Do I need to check not released versions (from sources)?
> Also TIFF compression 4 isn't supported, but I saw Issue that Sanselat 1.0 is support it, but 1.0 isn't released yet.

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

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (SANSELAN-64) Sanselan 0.97 can't read TIFF file without tag "Samples Per Pixel"

Richard (Jira)
In reply to this post by Richard (Jira)

     [ https://issues.apache.org/jira/browse/SANSELAN-64?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

VVD updated SANSELAN-64:
------------------------

    Summary: Sanselan 0.97 can't read TIFF file without tag "Samples Per Pixel"  (was: Sanselat 0.97 can't read TIFF file without tag "Samples Per Pixel")
   

> Sanselan 0.97 can't read TIFF file without tag "Samples Per Pixel"
> ------------------------------------------------------------------
>
>                 Key: SANSELAN-64
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-64
>             Project: Commons Sanselan
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 0.97
>         Environment: Any
>            Reporter: VVD
>             Fix For: 1.0
>
>
> {code:title=Test.java|borderStyle=solid}
> package test;
> import ...;
> public class Test {
> public static void main (String[] args) {
> File fin = new File("/file.tif");
> File fout = new File("/file.png");
> try {
> Map params = new Hashtable();
> BufferedImage image = Sanselan.getBufferedImage(fin);
> Sanselan.writeImage(image, fout, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {code}
> org.apache.sanselan.ImageReadException: Missing expected field: 277 (0x115: Samples Per Pixel):
> at org.apache.sanselan.formats.tiff.TiffDirectory.findField(TiffDirectory.java:186)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:463)
> at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
> at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
> at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1231)
> at test.Test.main(Test.java:24)
> 24 is line: "BufferedImage image = Sanselan.getBufferedImage(fin);"
> I look at sources and see that TIFF_TAG_SAMPLES_PER_PIXEL is mandatory tag:
> "int samplesPerPixel = directory.findField(TIFF_TAG_SAMPLES_PER_PIXEL, *true*).getIntValue();"
> Why?
> ImageMagick simple show warning and convert it correctly:
> Unknown field with tag 32309 (0x7e35) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> Unknown field with tag 32950 (0x80b6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/761.
> KDE applications (gwenview, okular, kolourpaint) show warning and open too:
> TIFFReadDirectory: Warning, Unknown field with tag 32309 (0x7e35) encountered.
> TIFFReadDirectory: Warning, Unknown field with tag 32950 (0x80b6) encountered.
> Do I need to check not released versions (from sources)?
> Also TIFF compression 4 isn't supported, but I saw Issue that Sanselat 1.0 is support it, but 1.0 isn't released yet.

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