[gdal-dev] How to check if image is valid?

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Fri Nov 15 04:41:56 PST 2013


Hi,

Is there some fast method to check if an image is valid? I am creating
overviews for some images and process yields this kind of errors:

G:\m150_wms>gdaladdo -r average -ro --config COMPRESS_OVERVIEW JPEG --config
PHOTOMETRIC_OVERVIEW YC
BCR --config INTERLEAVE_OVERVIEW PIXEL TTEC_2011_M150_TM35_R4332B.TIF 2 4 8
16 32 64
0Warning 1: File open for read-only accessing, creating overviews externally.
...10...20Warning 1: JPEGLib:Premature end of JPEG file
ERROR 1: JPEGLib:Not a JPEG file: starts with 0x00 0x00
ERROR 1: TIFFReadEncodedTile() failed.
ERROR 1: IReadBlock failed at X offset 36, Y offset 13
ERROR 1: GetBlockRef failed at X block offset 36, Y block offset 13
...30...40...50...60...70...80...90...100 - done.

Now I would like to run a check for a few thousand images and check if they
are healthy. What is the recommended method to do it? Is it possible to run
gdal_translate by using some dummy output format and capture just the
filename and exit code into a log file so I could sort the images into good
ones and probably corrupted? Or can I use gdalinfo with some parameters for
this purpose?


-Jukka Rahkonen-



More information about the gdal-dev mailing list