[Gdal-dev] compression CCITTFAX4 ?

Frank Warmerdam warmerdam at pobox.com
Mon Jan 30 11:54:01 EST 2006


On 1/30/06, Ivan Mjartan <ivan.mjartan at geovap.cz> wrote:
>
> Hi list,
>
> I have little problem with one raster
>
> This raster is info by gdalinfo.exe
>
> Driver: GTiff/GeoTIFF
> Size is 29320, 23915
> Coordinate System is `'
> Origin = (-526217.400234,-1169079.558552)
> Pixel Size = (0.20988818,-0.20988818)
> Metadata:
>   TIFFTAG_XRESOLUTION=1000
>   TIFFTAG_YRESOLUTION=1000
>   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
> Image Structure Metadata:
>   COMPRESSION=CCITTFAX4
> Corner Coordinates:
> Upper Left  ( -526217.400,-1169079.559)
> Lower Left  ( -526217.400,-1174099.034)
> Upper Right ( -520063.479,-1169079.559)
> Lower Right ( -520063.479,-1174099.034)
> Center      ( -523140.439,-1171589.296)
> Band 1 Block=29320x23915 Type=Byte, ColorInterp=Palette
>   Color Table (RGB with 2 entries)
>     0: 255,255,255,255
>     1: 0,0,0,255
>
> But problem is when I tried
>
> gdal_translate.exe -of BMP bohuslavice_pk.tif bohuslavice_pk.bmp
>
> I got following error
>
> ERROR 1: Internalize failed
> ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0

Ivan,

I believe the problem is that to GDAL the TIFF files seems to be
one big tile.  So when it reads it, it allocates a 29320x23915
memory array which fails, resulting in the error message you see.

I would suggest using tiffcp to convert the file into a stripped
file with a reasonable strip size.

eg.

tiffcp -s -r 200 your.tif stripped.tif

Then it should be possible to operate on it with gdal_translate.

But the other thing I must warn you is that GDAL treats 1bit TIFF
files as 8bit so the resulting image may be much larger than you
would expect (circa 500MB).

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list