Skip to main content
August 14, 2009
Question

dpi of an image

  • August 14, 2009
  • 2 replies
  • 3089 views

Hi,

How to find an dpi of an image using coldfusion?

is there any way to modify an images dpi using coldfusion?

    This topic has been closed for replies.

    2 replies

    Participant
    April 9, 2013

    Try:

    tImage=imageRead(pathToSourceImage);

    writeDump(ImageGetEXIFMetadata(tImage)['X Resolution'],'console');

    I'm using CF9

    August 18, 2009

    Using CF 8 you can resize an image, but not, so far as I can see, set the dpi of an image.

    I think that it is expected that the image file will be optimised for the web before it is uploaded, using tools such as Photoshop, Microsoft Photo Gallery, HP Photosmart.

    Not sure if CF 9 improves on this position. It is not expressly mentioned in any of the releases.

    Cheers

    bryn51

    Inspiring
    August 18, 2009

    ImageGetEXIFMetadata()

    August 18, 2009

    ImageGetEXIFMetadata(name) gets the infor required in a structure, but there does not appear to be a mechanism for expressly setting the pixel density.

    Of course there is ImageScaleToFit(name, fitWidth, fitHeight [, interpolation , blurFactor])  but that does not allow the pixel density to be expressly set (as a number) either, but by intelligent use or experimentation with the interpolation, it might suit the mans purpose in downsizing the file size, after all there are people out there that will happily upload a 3 MB jpeg image from their camera without giving it a thought.