I have written a PHP routine to read a high-resolution (300-350ppi) CMYK JPEG image, convert it to sRGB and down size it to 72ppi. The script seems to be working fine for most images, but some images cause the server to return a 502 Bad Gateway page. How can I determine what error is being generated and what's causing the error.
I original had the following command
$img = new Imagick($file_full_path);
I've tried creating an empty Imagick object and reading the file into it. fopen($file_full_path) does not produce any errors but if I then try to use a readImageFile command, I get the same results.
The JPEG file I'm working with is less than 5MB. I have tried resaving the image in Photoshop. Any suggestions?