How to read DPI of local image/bitmap?
…when user “uploads” image via FileReference.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming your image even has a DPI value encoded in it the value is meaningless. I could make a 64px x 64px image that has it’s DPI value set to 300, it would still not be a good candidate for printing. This article goes into greater detail.
What you should do instead is determine what DPI value you will print images at (usually this is 300 DPI) then calculate the value based on the pixel dimensions of the image. Here’s one way to calculate print size based on source image size.