On Mon, 23 Apr 2012 16:54:10 +0200, Even Rouault wrote:
Selon [email protected]:

Hi,

I've a few thousand aerial uncompressed tiff photography that I would
like to convert to tiff with jpeg compression, unfortunatly I can't
figure the right options to set to overcome the following error :

gdal_translate -of Gtiff -co "COMPRESS=JPEG"
"D:\uncompressed_original.tif" "D:\tiff_jpeg_copy.tif"

ERROR 1: JPEGSetupEncode:BitsPerSample 16 not allowed for JPEG
ERROR 1: An error occured while writing a dirty block
ERROR 1: JPEGSetupEncode:BitsPerSample 16 not allowed for JPEG

I've tried to use -co NBITS without success (gdal 1.9), the output
becomes a paletted file.

Did you try -co BITS=12 ? JPEG compression only supports 8 or 12
bits. (For 12
bit support, you must have a build of GDAL configured with its
internal libtiff
and internal libjpeg compiled with 12 bit support)

thanks for the reply, I did try with NBITS=8 and 12 with osgeo4w's gdal and tamas' nightly build but the output results are incorrect

Here is a sample file (93Mo) :
http://dl.free.fr/iFT4hH3Yj

I'll try to rebuild gdal on my linux box with the internal libs
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to