<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: FixDPI</title>
    <description>The latest articles on DEV Community by FixDPI (@fixdpi).</description>
    <link>https://dev.to/fixdpi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4238160%2F5c2f9d38-fddb-4b61-84b9-8924b300882b.png</url>
      <title>DEV Community: FixDPI</title>
      <link>https://dev.to/fixdpi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fixdpi"/>
    <language>en</language>
    <item>
      <title>Why a JPEG can report two different DPI values</title>
      <dc:creator>FixDPI</dc:creator>
      <pubDate>Wed, 11 Nov 2026 02:36:40 +0000</pubDate>
      <link>https://dev.to/fixdpi/why-a-jpeg-can-report-two-different-dpi-values-3f2a</link>
      <guid>https://dev.to/fixdpi/why-a-jpeg-can-report-two-different-dpi-values-3f2a</guid>
      <description>&lt;p&gt;Open the same JPEG in Windows Explorer, Photoshop and a web-based checker and you might get 72, 300 and 96. This isn't a bug in any one of them. JPEG has two places to store resolution and nothing forces them to agree.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;JFIF (APP0)&lt;/strong&gt;: a units byte (0 = aspect ratio only, 1 = dots per inch, 2 = dots per cm) followed by Xdensity and Ydensity as 16-bit integers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EXIF (APP1)&lt;/strong&gt;: XResolution and YResolution as RATIONAL values, ResolutionUnit as 2 (inch) or 3 (cm).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Some programs read JFIF first, some read EXIF first, and some ignore both and show the screen's DPI. MS Paint is the classic example of the last one.&lt;/p&gt;

&lt;p&gt;How it goes wrong in practice: an editor updates EXIF when you save for print but leaves JFIF at 72. Or a phone writes EXIF 72 and no JFIF at all, and a library adds a JFIF header with a 1:1 aspect ratio (units = 0), which some readers treat as "unknown, assume 72".&lt;/p&gt;

&lt;p&gt;If you are writing code that sets DPI, the safe approach is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write the same value to both JFIF and EXIF if they exist.&lt;/li&gt;
&lt;li&gt;Don't decode and re-encode the scan data. Copy it byte for byte, so image quality and other metadata stay as they are.&lt;/li&gt;
&lt;li&gt;Read the output back and check both fields before you hand the file over.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is how &lt;a href="https://fixdpi.com" rel="noopener noreferrer"&gt;FixDPI's browser DPI converter&lt;/a&gt; works, and its &lt;a href="https://fixdpi.com/dpi-checker" rel="noopener noreferrer"&gt;DPI checker&lt;/a&gt; shows the values a particular file is carrying.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>images</category>
    </item>
  </channel>
</rss>
