Creating GridCoverage2D from BufferedImage.TYPE_USHORT_555_RGB throws Exception
-------------------------------------------------------------------------------

                 Key: GEOT-3504
                 URL: http://jira.codehaus.org/browse/GEOT-3504
             Project: GeoTools
          Issue Type: Bug
          Components: core coverage
    Affects Versions: 2.7.0
            Reporter: Michael Bedward
            Assignee: Michael Bedward
             Fix For: 2.7.1, 2.8-M1


>From post by Markus on the user list:

BufferedImage image = ImageIO.read(filename);
GridCoverage2D grid = factory.create("results", image, new 
ReferencedEnvelope(y1, y2, x1, x2, crs));

->

Exception in thread "BackgroundImageRenderer-0" 
java.lang.IllegalArgumentException: Illegal argument: "type=null".
       at org.geotools.coverage.TypeMap.map(TypeMap.java:407)
       at org.geotools.coverage.TypeMap.isFloatingPoint(TypeMap.java:362)
       at 
org.geotools.coverage.grid.RenderedSampleDimension.create(RenderedSampleDimension.java:252)
       at 
org.geotools.coverage.grid.RenderedSampleDimension.create(RenderedSampleDimension.java:138)
       at 
org.geotools.coverage.grid.GridCoverage2D.<init>(GridCoverage2D.java:233)
       at 
org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:590)
       at 
org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:514)
       at 
org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:455)

BufferedImage.TYPE_BYTE_INDEXED and BufferedImage.TYPE_INT_RGB work fine, but 
the native format of the picture is TYPE_USHORT_555. Conversion takes time and 
BYTE_INDEXED loses quality and TYPE_INT_RGB takes too much memory.

>From the code of TypeMap it seems that it should support 16 bit images.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to