title: cmyk to rgb using php
body: <p>I'm using the following script to save images on a folder, but there is one image that shows this message "the image cannot be displayed because it contains errors".</p>
  
  <p>I think the problem is something called cmyk and rgb on the image, but when searching on the web for a way so convert cmyk to rgb using php I can't find an example of how to do this.</p>
  
  <p>Here is one of example: <a href="http://offshootinc.com/blog/2008/10/24/using-the-imagick-class-to-convert-a-cmyk-jpeg-to-rgb/" rel="noreferrer">http://offshootinc.com/blog/2008/10/24/using-the-imagick-class-to-convert-a-cmyk-jpeg-to-rgb/</a> but I don't undestand how to use that in my case.</p>
  
  <p>The link for the image is something like: www.example.com/attachment?id=2290</p>
  
  <p>The script is as follow:</p>
  
  <pre><code>&lt;?php 
  $image = 'http://www.dealrush.ie/attachment?id=2290';
  $name = 'somename';
  $alt = 'somealt';
  $saveimage = file_get_contents($image);
  file_put_contents("/usr/local/pem/vhosts/155030/webspace/httpdocs/img/$name.jpg", $saveimage);?&gt;
  </code></pre>
  
  <p>Later in some pages I will use something like this to show the image.
  &lt;img src=&quot;http://www.example.com/img/<code>&lt;?php echo $name?&gt;</code>.jpg&quot; alt=&quot;<code>&lt;?php echo $alt?&gt;</code>&quot; height=&quot;127px&quot; width=&quot;190px&quot;/&gt;</p>
  
  <p>Any help with converting these images will be appreciated
  Thanks 
  Daniel</p>