[gdal-dev] What happens by default when writing RGBA into jpeg?

Eli Adam eadam at co.lincoln.or.us
Tue Jun 10 08:40:01 PDT 2014


On Tue, Jun 10, 2014 at 6:28 AM, Even Rouault
<even.rouault at mines-paris.org> wrote:
>
>> Thanks, that makes sense. However, the result is somehow surprising and I
>> guess that in most cases unusable for the user. I wonder if it would be good
>> to print something like "WARNING. Encountered 4 source bands, assuming CMYC
>> color space". Behaviour is not very easy to understand by reading the driver
>> page http://www.gdal.org/frmt_jpeg.html
>>
>> When I try to look at the situation as a QGIS user sees it, it feels like
>> there is a bug somewhere but I can't say exactly where. However, I do not
>> believe that any average QGIS user can have success with converting their
>> RGBA tiffs into jpeg format even it is possible by editing gdal_translate
>> command manually.
>
> Agreed that the current behaviour is confusing. A check could be done on the
> color interpretation of the source bands to check if it is C,M,Y,K when a 4 band
> dataset is provided. If not, then output the warning (and possibly error out if
> -strict is specified)

Some GDAL warning also give helpful hints.  Could this warning suggest
something like, RGBA files can be converted to JPEG by adding "-b 1 -b
2 -b 3"?

Eli

> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list