[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] JPEG native lib / enum / colour space long-standing bug?
From:       philip.race () oracle ! com (Phil Race)
Date:       2012-05-15 21:07:35
Message-ID: 4FB2C597.9090700 () oracle ! com
[Download RAW message or body]


IJG was stable for many years but in the last few years seems to have come
back to life and has additional values but which do not overlap with the
3rd party additions except for RGBA.

But there's a bit more to it than that. RGBA has been supported by the 
Oracle JDK
as a consequence of  some 3rd party (closed source) additions to the IJG
library dating back to 1997/8. And the java constants Damon saw matches
the modified library's jpeglib.h.

As long as you stayed within the set of values before the additional ones
then you'd be fine with OpenJDK.  I expect you should still be fine with
Oracle JDK 7 with RGBA too ..


-phil.


On 5/15/2012 1:00 PM, 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
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic