Skip to main content
Inspiring
June 10, 2008
Question

cfimage Producing Strange Colors

  • June 10, 2008
  • 3 replies
  • 937 views
In a attempt to create thumbnails dynamically I'm using the cfimage tag with the action of resize. The resizing is perfect, however the color on the resized image has been changed to almost look like a negative with florescent colors.

As seen here: http://nucfug.org/cfimage.png

The code I'm using is below. Thanks for any tips or helpful nudges in the right direction.
    This topic has been closed for replies.

    3 replies

    Inspiring
    June 11, 2008
    what type of image are you dealing with? png? jpeg? gif? ???

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    June 11, 2008
    It's a jpg. However, when I tried to upload the image using IE 7 I got an error about not accepting the image/pjpeg MIME type. So, I added "image/pjpeg" to the accept attribute of the cffile tag that uploads the image. As seen below.
    June 11, 2008
    I think I might know what this problem is.

    At my work place we use our own custom built CMS that runs on PHP (I'm not a developer you see, I'm a designer, CF is my spare time interest).

    Anyway, when some of our customers upload some JPEGs they get similar problems and I think it's to do with them being Photoshop JPEG files set in a colour palette of CMYK as opposed to RGB. If you convert the image to RGB and try again does that solve the problem?

    I know that the PHP CMS we use differs entirely to CF, but similar problems may root to the same kind of cause.

    Hope this helps.

    Mikey.
    Inspiring
    June 11, 2008
    Thanks for the reply, MIkey.

    In the documentation I read that by leaving the height empty and giving the width a specific value cfimage will actually keep the aspect ratio of the image as it resizes. This is how I understood it, and think is pretty slick.

    The color craziness also happened when I was using percentage values in both the height and width.

    -Scott
    June 11, 2008
    The height attribute is empty, try removing anything that isn't necessary. Look at the docs to see what the defaults are. I'm not sure really other than that cos I haven't played with it much.

    Good luck.
    Mikey.