Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6957671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:02:06+00:00 2026-05-27T15:02:06+00:00

For example, C # says that the selected image contains 96 ppi, while that

  • 0

For example, C # says that the selected image contains 96 ppi, while that same image in Photoshop contains 72 ppi.

Why is there a difference?

I’m inclined to trust Photoshop in this case, and how to test image resolution if C# returns false results?

We need to build some sort of validator control that rejects all images with ppi != 300.

Control should support the following formats: jpg, jpeg, gif, png, bmp.

Code is listed below:

Image i = Image.FromFile(FileName);

Console.Write(i.VerticalResolution);
Console.Write(i.HorizontalResolution);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:02:07+00:00Added an answer on May 27, 2026 at 3:02 pm

    DPI means dots (pixels) per inch. The physical size in inches is subjective, based on the current monitor’s size and resolution. Unless you’re relying on metadata (which gif and bmp don’t contain) you cannot reliably calculate this.

    Photoshop simply has a prescribed value for DPI, which it uses when translating images for print. This value is stored in the PSD file and may be copied to JPEG metadata, but if you save the image in a format without DPI metadata, the information is not stored.

    Update:

    The reason your code gets a different value is that C# fetches its VerticalResolution and HorizontalResolution values from the current DPI setting on the computer. Photoshop’s DPI is for use with print, so it knows the physical dimensions if you want to send your image to a printer. It has a default value of 72dpi, but you can change this. The value has no meaning on a screen, though, since screens deal in pixels only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this example that says: var arr=$.map([0,1,2],function(n){ return [n,n+1]; }); Will make arr
YSlow says that images referenced from my CSS file (background image, for example) are
this is an example taken from Effective C++ 3ed , it says that if
I follow this pattern to organize my js application. As that example says our
The questions says everything, take this example code: <ul id=css-id> <li> <something:CustomControl ID=SomeThingElse runat=server
From http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html#99740 example A3.3 says, it says that an object might still not be
Google says that the content is duplicated www.example.com/pagedcontent/page3 / www.example.com/pagedcontent/page3 I redirected using redirect
Is there any theory that says that a cache should be faster than a
There is an interesting coding standard in my shop that says that we don't
Documentation can be found here It says in the example: onDrop: Called whenever a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.