close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Image Properties - DPI / PPI

Thread began 8/16/2009 8:27 pm by Les Crowley | Last modified 8/31/2009 11:55 am by Jason Byrnes | 6998 views | 9 replies |

Les CrowleyBeta Tester

Image Properties - DPI / PPI

I'm looking to pull a bit of additional information when an image is uploaded (aside from width and height).

The info that I'm trying to get is the DPI (dots per inch) and PPI (pixels per inch).

First question. Is this information available at upload using Digital File Pro and if so how would I modify the DFP script to get it?

Second question. is it possible to get the width and height in inches instead of pixels? Again how would I modify the DFP script to achieve this?

Sign in to reply to this post

anonymous

Les,

Have you tried using a DPI PHP script such as the one here: php-dpi/

I believe this would do the trick for the DPI... you would just have to upload the file first and then pass the value through to the script... but could certainly modify your Digital File Pro to make a pass through the script.

Cheers,

Brian

Sign in to reply to this post

Les CrowleyBeta Tester

Brian thanks for the quick reply. I looked at the script and based upon the comments within it I don't think it's going to work.

"I have tried this function to get DPI value of an image that
I generated using Photoshop and worked as expected but failed
to get DPI value from an image from any digital camera."

The images that are being uploaded are coming from digital cameras. Perhaps the way DPI is written when the image is created with a digital camera is different than with Photoshop.

I'm not a digital image or photoshop expert so any help / ideas is appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

Digital File pro uses the PHP GD Library to return the height and width of an image, unfortunately, the GD Library cannot be used to return the DPI or PPI values as well.

Sign in to reply to this post

Les CrowleyBeta Tester

Thanks Jason. Do you know of any way that DPI / PPI can be obtained?

The problem I'm having is that I need to know the DPI so that I can calculate a print of an uploaded image. Not knowing the DPI makes the width and height useless since a 1000 x 1000 72dpi image is very different than a 1000 x 1000 150dpi (or 300dpi) image.

Sign in to reply to this post

Jason ByrnesWebAssist

Sorry, I am not familiar with any PHP methods to return the DPI settings of an image.

Sign in to reply to this post

Les CrowleyBeta Tester

As it turns out... If I select Web Images Only option - DFP recreates the image as 72dpi but does not write the dpi info to the file - regardless of what the dpi of the original file is.

If I leave the Web Images Only option unselected then it leaves the original image alone and it retains it's original dpi and dpi data - however there is no width or height information available for the file.

Any thoughts on how I can get that width and height info when Web Images Only is not selected? Or how to prevent the image from being recreated at 72dpi and retaining the dpi info if I do select Web Images Only (which btw - IMAGES ONLY would be a better option).

Sign in to reply to this post

Jason ByrnesWebAssist

The GD functions that are used by Digital File for creating the image default to 72 DPI, and they do not offer a way to change that. I searching I came across the following:
php-jpegjpg-dpi-function.html

basically, it seams to be a process to handle setting the DPI of an image in PHP which is not supported by Digital File Pro.

Sign in to reply to this post

mr.joebert388094

I stumbled across this thread while looking through my blogs referrer logs and just wanted to leave a little note about the link to my blog post Jason Byrnes posted pointing to there.

That function was designed for use with JPEG images and wrote while looking at the file header specs of a JPEG image. It works on the same principle as the function referred to by SOJO web.

A digital camera is probably producing TIFF, RAW, or some other format images unless it's a point-n-shoot camera or a cellphone camera. Better cameras generally don't produce JPEG images because JPEG is a format that trashes some information and generates the displayed image using algorithms in order to save filesize where as TIFF/RAW/etc are "lossless" formats that store every single pixel in the image file.

I'm not familiar with the inner workings of these image formats, but if they store DPI information it should be in a standard location that can be read just like the JPEG DPI functions mentioned in this thread do.

Sign in to reply to this post

Jason ByrnesWebAssist

Thanks for posting the clarification.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...