Bulk convert images with PHP GD2

Posted on 2009-04-27
Last Modified: 2012-05-06
I have a directory on my server filled with .jpg images, the problem is some of these images are in CMYK and don't display in Internet Explorer as it only shows RGB images. I'd like to convert all these images to RGB format. I currently have PHP with GD and was wondering if there was a way to bulk convert all these images in this directory and it's sub directories from the command line?
Question by:TotallyMe
    LVL 9

    Accepted Solution

    LVL 16

    Assisted Solution

    by:Chris Harte
    cmyk images are not natively supported by php. To convert them you are going to have use the imagemagick PECL extention.
    These are undocumented on the php site, which does not help, but here is a function that might.

    There is also a user group where they discuss the same problem.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now