[gdal-dev] Having trouble working with jp2 files

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Tue Jun 19 13:57:30 PDT 2018


Hi all,

I'm having a problem readding jp2 files. My goal is to be able to 
display them through mapserver, but I'm have problems with gdalinfo and 
gdal_translate. I set up a docker image with the latest gdal2 in it like 
the following.  I have 1074 jp2 files and all that I have tried are 
throwing the same errors as below. Any ideas on what is going on?

-Steve

$ docker pull geographica/gdal2:latest
# cd to where 850011.* exists
# this runs the container and mounts pwd on /data in the container
$ docker run -t -i -v $(pwd):/data geographica/gdal2 /bin/bash

root at 2730a320bc09:/usr/local# gdalinfo /data/850011.jp2
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: /data/850011.jp2
Size is 29364, 25856
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"]]
Origin = (50.811767578125000,18.406654712112974)
Pixel Size = (0.000020390753690,-0.000020390753690)
Image Structure Metadata:
   INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  50.8117676,  18.4066547) ( 50d48'42.36"E, 18d24'23.96"N)
Lower Left  (  50.8117676,  17.8794314) ( 50d48'42.36"E, 17d52'45.95"N)
Upper Right (  51.4105217,  18.4066547) ( 51d24'37.88"E, 18d24'23.96"N)
Lower Right (  51.4105217,  17.8794314) ( 51d24'37.88"E, 17d52'45.95"N)
Center      (  51.1111446,  18.1430430) ( 51d 6'40.12"E, 18d 8'34.95"N)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red
   Overviews: 14682x12928, 7341x6464, 3670x3232, 1835x1616, 917x808
   Overviews: arbitrary
   Image Structure Metadata:
     COMPRESSION=JPEG2000
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green
   Overviews: 14682x12928, 7341x6464, 3670x3232, 1835x1616, 917x808
   Overviews: arbitrary
   Image Structure Metadata:
     COMPRESSION=JPEG2000
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue
   Overviews: 14682x12928, 7341x6464, 3670x3232, 1835x1616, 917x808
   Overviews: arbitrary
   Image Structure Metadata:
     COMPRESSION=JPEG2000

root at 2730a320bc09:/usr/local# gdalinfo -stats /data/850011.jp2
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: /data/850011.jp2
Size is 29364, 25856
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"]]
Origin = (50.811767578125000,18.406654712112974)
Pixel Size = (0.000020390753690,-0.000020390753690)
Image Structure Metadata:
   INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  50.8117676,  18.4066547) ( 50d48'42.36"E, 18d24'23.96"N)
Lower Left  (  50.8117676,  17.8794314) ( 50d48'42.36"E, 17d52'45.95"N)
Upper Right (  51.4105217,  18.4066547) ( 51d24'37.88"E, 18d24'23.96"N)
Lower Right (  51.4105217,  17.8794314) ( 51d24'37.88"E, 17d52'45.95"N)
Center      (  51.1111446,  18.1430430) ( 51d 6'40.12"E, 18d 8'34.95"N)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red
ERROR 1: psImage->comps[0].data == nullptr
ERROR 1: /data/850011.jp2, band 1: IReadBlock failed at X offset 0, Y 
offset 0: psImage->comps[0].data == nullptr
   Overviews: 14682x12928, 7341x6464, 3670x3232, 1835x1616, 917x808
   Overviews: arbitrary
   Image Structure Metadata:
     COMPRESSION=JPEG2000
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green
ERROR 1: psImage->comps[0].data == nullptr
ERROR 1: /data/850011.jp2, band 2: IReadBlock failed at X offset 0, Y 
offset 0: psImage->comps[0].data == nullptr
   Overviews: 14682x12928, 7341x6464, 3670x3232, 1835x1616, 917x808
   Overviews: arbitrary
   Image Structure Metadata:
     COMPRESSION=JPEG2000
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue
ERROR 1: psImage->comps[0].data == nullptr
ERROR 1: /data/850011.jp2, band 3: IReadBlock failed at X offset 0, Y 
offset 0: psImage->comps[0].data == nullptr
   Overviews: 14682x12928, 7341x6464, 3670x3232, 1835x1616, 917x808
   Overviews: arbitrary
   Image Structure Metadata:
     COMPRESSION=JPEG2000

root at 2730a320bc09:/usr/local# gdal_translate -of GTiff /data/850011.jp2 
/data/850011.tif
Input file size is 29364, 25856
0ERROR 1: psImage->comps[0].data == nullptr
ERROR 1: /data/850011.jp2, band 1: IReadBlock failed at X offset 0, Y 
offset 0: psImage->comps[0].data == nullptr

root at 2730a320bc09:/usr/local#


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the gdal-dev mailing list