j***@gmail.com
2015-11-10 16:18:42 UTC
Hi everyone,
I'm trying to add RGBA read and write via libjpeg-turbo to my
image-processing library using the IJG API.
Write seems to be simple, I just set in_color_space and
jpeg_color_space to JCS_EXT_RGBA, gave it 4 byte pixels, and I seem to
get a file that's a bit bigger.
But for the reader, I need to be able to tell if a .jpg file has been
written with this extra channel. I've puzzled over the docs and I
can't see it. How can you tell if a .jpg has an alpha?
I've tried calling jpeg_read_header() but jpeg_color_space is always
JCS_YCbCr and out_color_space seems to be always JCS_RGB, I guess for
compatibility. Where should I be looking?
Or perhaps I'm not writing the file correctly? Does anyone have an
example RGBA file I could use for testing?
This is with libjpeg-turbo from git master, if that makes a difference.
John
------------------------------------------------------------------------------
I'm trying to add RGBA read and write via libjpeg-turbo to my
image-processing library using the IJG API.
Write seems to be simple, I just set in_color_space and
jpeg_color_space to JCS_EXT_RGBA, gave it 4 byte pixels, and I seem to
get a file that's a bit bigger.
But for the reader, I need to be able to tell if a .jpg file has been
written with this extra channel. I've puzzled over the docs and I
can't see it. How can you tell if a .jpg has an alpha?
I've tried calling jpeg_read_header() but jpeg_color_space is always
JCS_YCbCr and out_color_space seems to be always JCS_RGB, I guess for
compatibility. Where should I be looking?
Or perhaps I'm not writing the file correctly? Does anyone have an
example RGBA file I could use for testing?
This is with libjpeg-turbo from git master, if that makes a difference.
John
------------------------------------------------------------------------------