[GRASS-dev] Re: [grass-code I][329] r.out.gdal: COMPRESS=JPEG yields "ERROR 1: JPEGSetupEncode:PhotometricInterpretation 3 not allowed for JPEG"

Maciej Sieczka tutey at o2.pl
Sat Apr 28 04:44:25 EDT 2007


Glynn Clements wrote:
> Maciej Sieczka wrote:

>> This bug still applies. I don't know why "format=GTiff type=Byte
>> createopt=COMPRESS=JPEG" do not work together. The output raster is all
>> black. According to GeoTIFF spec JPEG compression should work just fine
>> with integer raster: "JPEG should only be used with Byte data" [1].

> I thought that I had replied to this already.
> 
> ...
> 
> Oh; I did, but none of the addresses in the original message accept
> replies, so it went into the bit-bucket.

Too bad, yes.

>> r.out.gdal creates paletted images (i.e. the map data is saved as a
>> single band; it isn't expanded to RGB).
>>
>> Note that the argument to creatopt= is passed directly to GDAL. 
>> r.out.gdal has no knowledge of which options are allowed or
>> meaningful, so it's up to the user not to pass options which won't work.

I guess I comply.

In spearfish:

$ g.region rast=vegcover
$ r.out.gdal in=vegcover format=GTiff type=Byte
out=tmp/vegcover_jpg.tif createopt=COMPRESS=JPEG


Is there something wrong with: "format=GTiff type=Byte
createopt=COMPRESS=JPEG" when exporting an integer raster, value range 1-6:

In spearfish:

$ r.info -t vegcover
datatype=CELL

$ r.info -r vegcover
min=1
max=6

in the context of what GDAL's GeoTIFF spec says: "JPEG should only be
used with Byte data"?

[1]http://www.gdal.org/frmt_gtiff.html

Maciek




More information about the grass-dev mailing list