ArrayIndexOutOfBounds during rendering GeoTIFF with ContrastEnhancement
-----------------------------------------------------------------------

                 Key: GEOS-4303
                 URL: http://jira.codehaus.org/browse/GEOS-4303
             Project: GeoServer
          Issue Type: Bug
          Components: WMS
    Affects Versions: 2.1-beta3
            Reporter: Torsten Heinen
            Assignee: Andrea Aime
         Attachments: gs21-beta3_contrastenhancement_exception.txt

I noticed the an error when rendering a GeoTIFF greyscale coverage with 
ContrastEnhancement enabled (same SLD as in 
http://docs.geoserver.org/latest/en/user/_downloads/raster_brightnessandcontrast.sld):

... (see attached file)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1934
        at javax.media.jai.IHSColorSpace.fromRGBByte(IHSColorSpace.java:500)
        at javax.media.jai.IHSColorSpace.fromRGB(IHSColorSpace.java:427)
        at 
com.sun.media.jai.opimage.ColorConvertOpImage.computeRectColorSpaceJAIFromRGB(ColorConvertOpImage.java:329)
        at 
com.sun.media.jai.opimage.ColorConvertOpImage.computeRect(ColorConvertOpImage.java:285)
        at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:857)
        at 
com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
        at javax.media.jai.OpImage.getTile(OpImage.java:1129)
        at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:911)
        at 
com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
        at javax.media.jai.OpImage.getTile(OpImage.java:1129)
        at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
        at 
javax.media.jai.StatisticsOpImage.getProperty(StatisticsOpImage.java:292)
        at 
com.sun.media.jai.opimage.ExtremaOpImage.getProperty(ExtremaOpImage.java:100)
        at javax.media.jai.RenderedOp$1.getProperty(RenderedOp.java:1808)
        at 
javax.media.jai.PropertyEnvironment.getProperty(PropertyEnvironment.java:197)
        at 
javax.media.jai.PropertySourceImpl.getProperty(PropertySourceImpl.java:277)
        at 
javax.media.jai.WritablePropertySourceImpl.getProperty(WritablePropertySourceImpl.java:130)
        at javax.media.jai.RenderedOp.getProperty(RenderedOp.java:1982)
        at 
org.geotools.renderer.lite.gridcoverage2d.ContrastEnhancementNode.performContrastEnhancement(ContrastEnhancementNode.java:499)
        at 
org.geotools.renderer.lite.gridcoverage2d.ContrastEnhancementNode.execute(ContrastEnhancementNode.java:342)
        at 
org.geotools.renderer.lite.gridcoverage2d.ContrastEnhancementNode.execute(ContrastEnhancementNode.java:74)
        at 
org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter$1.execute(StyleVisitorCoverageProcessingNodeAdapter.java:134)
        at 
org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted(BaseCoverageProcessingNode.java:237)
        at 
org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:339)

1) The error is only thrown when the request BBOX completely lies within the 
coverage, i.e. if no nodata areas are rendered.
2) The same coverage is rendered correctly, when removing the 
<ContrastEnhancement> part or zooming out (see 1)).

The gdalinfo output of the GeoTIFF:
Size is 6495, 11312
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
GeoTransform =
  22.97080201092148, 5.491517768717615e-05, 9.544615081555327e-06
  36.60394296101818, 7.63171004007839e-06, -4.439475925661741e-05
Metadata:
  AREA_OR_POINT=Point
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  22.9708020,  36.6039430) ( 22d58'14.89"E, 36d36'14.19"N)
Lower Left  (  23.0787707,  36.1017494) ( 23d 4'43.57"E, 36d 6'6.30"N)
Upper Right (  23.3274761,  36.6535109) ( 23d19'38.91"E, 36d39'12.64"N)
Lower Right (  23.4354448,  36.1513174) ( 23d26'7.60"E, 36d 9'4.74"N)
Center      (  23.2031234,  36.3776302) ( 23d12'11.24"E, 36d22'39.47"N)
Band 1 Block=6495x1 Type=UInt16, ColorInterp=Gray
    Computed Min/Max=0.000,25079.000

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

        

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to