Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

get image resolution (dpi)

New Here ,
May 12, 2010 May 12, 2010

Hello,

Is there a way to get the image resolution or dpi?

I have tried something like this:

<cfimage action="read" source="files/HK1002010-0849.jpg" name="myImage" />
<cfset exif = ImageGetEXIFMetadata(myImage) />
<cfdump var="#exif#" label="Exif Metadata">
<cfdump var="#myImage#" label="Exif Metadata">

<hr />

<cfoutput>
#ImageGetEXIFTag(myImage, "X Resolution")#
</cfoutput>

but it's shows 72 at all times, so also when an image is 300dpi, it shows 72.

Can someone help me?

Thanks!

640
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2010 May 12, 2010

http://www.leavethatthingalone.com/blog/index.cfm/2007/7/18/ColdFusion8_Exif_and_IPTC

<cfimage action="read" source="IMG_2479.JPG" name="myImage" />

<cfset exif = ImageGetEXIFMetadata(myImage) />

<cfdump var="#exif#" label="Exif Metadata">

Ken Ford

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2010 May 13, 2010
LATEST

Hi Ken,

Thanks for your reply. That script is not working completly. It alway returns 72DPI, also on a 300DPI picture. I have bought a cfx tag to accomplish this.

I do have an other question. I want to open the file in Photoshop, while photshop is not the default program for JPG files. I have something like this:

<cfheader name="Content-Type" value="unknown">
<cfheader name="Content-Disposition" value="attachment; filename=#URL.File2Download#">
<cfcontent type="Application/photoshop" file="#application.serverPath#\files\#URL.File2Download#" deletefile="No">

which is not working. Can someone help me on this one?

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources