Skip to main content
Known Participant
May 24, 2010
Question

CFIMAGE displays PNG files incorrectlyI

  • May 24, 2010
  • 3 replies
  • 1698 views

I have numerous websites in CF 8 that use CFIMAGE to grab an image file and display it in the browser. Suddenly today, if the original image was in PNG format it does not display the image correctly. It appears to be a color space issue, but I'm not sure. I've tried using CFIMAGE to grab a few test PNG images, verifying the images are fine, and it does not work. Images in JPG format are properly served to the browser in the converted PNG image.

The resulting image is attached here - it should be a pic of a female golfer.

Any help is appreciated.

    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    May 25, 2010

    Oh, you should have upgraded and updated your server to the latest cumulative hotfix of CF8.0.1

    Known Participant
    May 29, 2010

    Thanks for all the information. We did have the latest CF8 updates, all to no avail. We then upgraded to CF 9 (in the plans anyway), completely removing and re-installing the new version. No luck. Any image that originates as a PNG is garbled by <CFIMAGE>, regardless of where it is stored.

    Unfortunately this issue remains. I agree it must be some other process on the server mangling the PNG, but I'm not sure where to look at this point. Any other suggestions are appreciated.

    Inspiring
    May 30, 2010

    The cfimage tag doesn't actually display an image.

    Yes. I thought they might be manipulating the images or performing a actions that require "interpretation" of the images. ie Something beyond just serving up the file. But maybe not ..

    ... Any image that originates as a PNG is

    garbled by <CFIMAGE>, regardless of where it is

    stored.

    When you say "originates" .. it suggests you are doing something beyond just displaying the images with a simple

    tag. Are you?

    Also, if you view the images with a regular image viewer, do they appear as you expect?

    BKBK
    Community Expert
    Community Expert
    May 25, 2010
    CFIMAGE displays PNG files incorrectly!

    The cfimage tag doesn't actually display an image. I suspect the image is corrupted by some process other than cfimage.

    The closest you can come to displaying with cfimage is the writeToBrowser action. So, for the purposes of elimination, I would run a test likethis

    test 1
    <div>
    <img src="test.png">
    </div>

    <br>test 2
    <div>
    <cfimage action="writeToBrowser" source="test.png">
    </div>

    Inspiring
    May 24, 2010

    Suddenly today,

    if the original image was in PNG format it does not display

    What was changed on the server recently (updates, patches, etcetera...)?

    and it does not work.

    What code and what do you mean by "does not work"? Does an error occur, the results are different than you expect, ...?

    Known Participant
    May 25, 2010

    Sorry, I could have been more clear. By "not working" I meant that the images are not displaying properly (please see the image attached to my original post).  Nothing has changed on the server, other than Windows security updates and a server reboot.

    We are considering upgrading to CF 9 anyway, but am wondering if the CFImage problem could be related to some other server component (Java?) that upgrading won't fix.

    Inspiring
    May 25, 2010

    Nothing has

    changed on the server, other than Windows security updates

    and a server reboot.

    Well, if every single .png image is displaying incorrectly, then it certainly suggests the cause is the updates. If possible, test the same code on another CF8 server, with a few of the images from the problem server. If the images display correctly, then its almost certainly the updates. Have you taken a look at what the updates entailed ?