title: Change JPEG file DPI header in Node.js
body: <p>I have a file (for example JPEG size 1588 × 2244px). It's generated by <code>puppeteer</code> (but <code>phantomjs</code> also generate <code>72 DPI</code> screenshot). When I save this image into a file with <code>.jpeg</code> extension and I use  macOS General Info I see:</p>
  
  <p><a href="https://i.stack.imgur.com/TkKmi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TkKmi.png" alt="enter image description here"></a></p>
  
  <p>As you can see it has <code>72 DPI</code> set in metadata, but I want to use file with <code>300 DPI</code>. I know, that in digital it doesn't change anything - it's property for printing, but I don't want to explain to each customer that this file could be print in <code>300 DPI</code>.</p>
  
  <p>When I use Gimp and <code>Image &gt; Print Size</code></p>
  
  <p><a href="https://i.stack.imgur.com/7kWzB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7kWzB.png" alt="enter image description here"></a></p>
  
  <p>I can change the DPI, and export a picture again. And now it has <code>300 DPI</code> in <code>General Info</code> window.</p>
  
  <p><a href="https://i.stack.imgur.com/2J0AJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2J0AJ.png" alt="enter image description here"></a></p>
  
  <p>I try to do it in Node.JS server, but I found few options to change this property on <code>.PNG</code> pictures, but anyone is working for <code>.JPEG</code> files.</p>
  
  <p>I think that the most accurate option is to use method <code>changeDpiDataUrl</code> from this library:
  <a href="https://github.com/shutterstock/changeDPI/blob/master/src/index.js" rel="nofollow noreferrer">https://github.com/shutterstock/changeDPI/blob/master/src/index.js</a>
  But when I put my image as <code>base64image</code>, after a <code>split</code> operation I have the <code>array</code> with 1 element only - I think that this is body, so I don't have format property (at 63 line).</p>
  
  <p>Anybody meet this problem before?  </p>