Skip to content

Error with JP2GROK driver on "gdalinfo -stats my.jp2" when my.jp2 is 2048x2048 #14257

@rouault

Description

@rouault

What is the bug?

CC @boxerab

$ gdal_translate autotest/gcore/data/rgbsmall.tif test.jp2 -outsize 2048 2048
$ gdalinfo test.jp2 -stats
Driver: JP2Grok/JPEG-2000 driver based on Grok library
Files: test.jp2
Size is 2048, 2048
Coordinate System is:
GEOGCRS["WGS 84",
    ENSEMBLE["World Geodetic System 1984 ensemble",
        MEMBER["World Geodetic System 1984 (Transit)"],
        MEMBER["World Geodetic System 1984 (G730)"],
        MEMBER["World Geodetic System 1984 (G873)"],
        MEMBER["World Geodetic System 1984 (G1150)"],
        MEMBER["World Geodetic System 1984 (G1674)"],
        MEMBER["World Geodetic System 1984 (G1762)"],
        MEMBER["World Geodetic System 1984 (G2139)"],
        MEMBER["World Geodetic System 1984 (G2296)"],
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]],
        ENSEMBLEACCURACY[2.0]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    USAGE[
        SCOPE["Horizontal component of 3D system."],
        AREA["World."],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-44.840319999999998,-22.932583999999999)
Pixel Size = (0.000083789062500,-0.000083789062500)
Image Structure Metadata:
  INTERLEAVE=PIXEL
  COMPRESSION_REVERSIBILITY=LOSSY
Corner Coordinates:
Upper Left  ( -44.8403200, -22.9325840) ( 44d50'25.15"W, 22d55'57.30"S)
Lower Left  ( -44.8403200, -23.1041840) ( 44d50'25.15"W, 23d 6'15.06"S)
Upper Right ( -44.6687200, -22.9325840) ( 44d40' 7.39"W, 22d55'57.30"S)
Lower Right ( -44.6687200, -23.1041840) ( 44d40' 7.39"W, 23d 6'15.06"S)
Center      ( -44.7545200, -23.0183840) ( 44d45'16.27"W, 23d 1' 6.18"S)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red
ERROR 1: localctx.psImage->comps[0].data == nullptr
ERROR 1: test.jp2, band 1: IReadBlock failed at X offset 1, Y offset 0: localctx.psImage->comps[0].data == nullptr
  Overviews: 1024x1024, 512x512, 256x256
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green
ERROR 1: localctx.psImage->comps[0].data == nullptr
ERROR 1: test.jp2, band 2: IReadBlock failed at X offset 1, Y offset 0: localctx.psImage->comps[0].data == nullptr
  Overviews: 1024x1024, 512x512, 256x256
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue
ERROR 1: localctx.psImage->comps[0].data == nullptr
ERROR 1: test.jp2, band 3: IReadBlock failed at X offset 1, Y offset 0: localctx.psImage->comps[0].data == nullptr
  Overviews: 1024x1024, 512x512, 256x256
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000

Steps to reproduce the issue

Versions and provenance

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    not for AI loversSee https://gdal.org/en/stable/community/ai_tool_policy.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions