[OpenJDK 2D-Dev] JPEG native lib / enum / colour space long-standing bug?

Damon Hart-Davis dhd at exnet.com
Tue May 15 20:13:06 UTC 2012


Hi,

OK, kewl!

I don't need any sort of immediate fix, having found a work-around, at least for now.

But is there anything else I need to do to help get this fixed for future generations?  B^>

Rgds

Damon



On 15 May 2012, at 21:00, Roman Kennke wrote:

> Hi Damon,
> 
>> Is anyone reading this list who is in a position to tell me if I'm even wrong?  B^>
> 
>> From reading the snippets you posted here:
> 
> http://mail.openjdk.java.net/pipermail/2d-dev/2012-May/002496.html
> 
> I think you are right, RGBA and beyond is not possible using the
> jpeglib.h that is included in OpenJDK.
> 
> However, looking at the same file of the libjpeg included in my Linux
> distro, I see this:
> 
> typedef enum {
>        JCS_UNKNOWN,            /* error/unspecified */
>        JCS_GRAYSCALE,          /* monochrome */
>        JCS_RGB,                /* red/green/blue as specified by the
> RGB_RED, RGB_GREEN,
>                                   RGB_BLUE, and RGB_PIXELSIZE macros */
>        JCS_YCbCr,              /* Y/Cb/Cr (also known as YUV) */
>        JCS_CMYK,               /* C/M/Y/K */
>        JCS_YCCK,               /* Y/Cb/Cr/K */
>        JCS_EXT_RGB,            /* red/green/blue */
>        JCS_EXT_RGBX,           /* red/green/blue/x */
>        JCS_EXT_BGR,            /* blue/green/red */
>        JCS_EXT_BGRX,           /* blue/green/red/x */
>        JCS_EXT_XBGR,           /* x/blue/green/red */
>        JCS_EXT_XRGB,           /* x/red/green/blue */
>        /* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX,
>           JCS_EXT_XBGR, or JCS_EXT_XRGB during decompression, the X
> byte is
>           undefined, and in order to ensure the best performance,
>           libjpeg-turbo can set that byte to whatever value it wishes.
> Use
>           the following colorspace constants to ensure that the X byte
> is set
>           to 0xFF, so that it can be interpreted as an opaque alpha
>           channel. */
>        JCS_EXT_RGBA,           /* red/green/blue/alpha */
>        JCS_EXT_BGRA,           /* blue/green/red/alpha */
>        JCS_EXT_ABGR,           /* alpha/blue/green/red */
>        JCS_EXT_ARGB            /* alpha/red/green/blue */
> } J_COLOR_SPACE;
> 
> 
> It looks like a lot of color spaces have been added in the meantime. :-)
> I believe the problems you mention should be possible to resolve by
> upgrading the shipped libjpeg. (Or, even better, use the system
> installed libjpeg as IcedTea does, and fix the colorspace verification
> code to include the extended color spaces.)
> 
> Regards,
> Roman
> 




More information about the 2d-dev mailing list