[problem solved] -> Is it possible to see if a jpeg is RGB or CMYK via PHP GD2?

From: Sed (sed_at_sed.is)
Date: 01/09/04


To: <php-general@lists.php.net>
Date: Fri, 9 Jan 2004 10:05:10 -0000

I was to fast on this list... I found the solution reading the manual
better ;)

...
With JPG images, two extra indexes are returned: channels and bits. channels
will be 3 for RGB pictures and 4 for CMYK pictures. bits is the number of
bits for each color.

Beginning with PHP 4.3, bits and channels are present for other image types,
too. However, the presence of these values can be a bit confusing. As an
example, GIF always uses 3 channels per pixel, but the number of bits per
pixel cannot be calculated for an animated GIF with a global color table.
...

-----Original Message-----
From: SED [mailto:sed@sed.is]
Sent: 9. janúar 2004 09:51
To: php-general@lists.php.net
Subject: [PHP] Is it possible to see if a jpeg is RGB or CMYK via PHP GD2?

I'm allowing user to upload images to a gallery. However, some user seem to
have both RGB and CMYK jpeg images. I get an error from ImageCreateFromJPEG
when the script is creating thumbnails from a CMYK jpeg. Can I somehow see
if the image is RGB or CMYK, so I know when to skip the automatic thumbnail
creation?
 
Regards,
SED



Relevant Pages

  • Re: RIP difficulties
    ... It's a setting about converting color spaces. ... Do you keep your images in RGB or were there RGB images in some embedded ... I'd be very careful of turning on color management for cmyk images since ...
    (comp.publish.prepress)
  • Re: JPG files > RGB or CMYK?
    ... We take RGB images, convert them to CMYK, process and print them. ... original files to be kept in the database are supposed to remain RGB. ...
    (comp.graphics.apps.photoshop)
  • Re: JPG files > RGB or CMYK?
    ... >The company I work for has a database of around 1,000,000 JPG images. ... The>original files to be kept in the database are supposed to remain RGB. ... >We believe that there was a problem with our archival process which may>have filtered a significant number of CMYK formatted images back into>our archive. ... I did some -rather trivial- programming around JPEG files recently in order to fix a bug in a commercial application producing jpegs with faulty headers, so I have the JPEG specs still on my desktop. ...
    (comp.graphics.apps.photoshop)
  • Re: CMYK to RGB conversion
    ... RGB and CMYK use different color space, so when an image is converted it is ... versions of PPT do not support CMYK images. ... > PowerPoint does this conversion? ...
    (microsoft.public.powerpoint)
  • Re: JPG files > RGB or CMYK?
    ... The original files to be kept in the database are supposed to remain RGB. ... We believe that there was a problem with our archival process which may have filtered a significant number of CMYK formatted images back into our archive. ...
    (comp.graphics.apps.photoshop)