title: Get/set DPI with PHP GD/Imagick?
body: <p>I'm building a Web application that will handle image files that will ultimately be printed, large format.</p>
  
  <p>As part of this, I need to get (i.e. read) and set (i.e. change) the DPI of an image file.</p>
  
  <p>Is this possible through PHP GD or PHP Imagick?</p>
  
  <p>Thanks,</p>
  
  <p>BK</p>
  
  <hr>
  
  <h2><strong>Edit:</strong></h2>
  
  <p>The DPI of a image can be accessed through iMagick's <code>getImageResolution</code> method:</p>
  
  <pre><code>public function getDPI() {
  
      $imgDPI = $this-&gt;image-&gt;getImageResolution();
      return $imgDPI;
  
  }
  </code></pre>
  
  <p>and the DPI of an image can be set through iMagick's <code>setImageResolution</code> method:</p>
  
  <pre><code>public function setDPI($DPIX, $DPIY) {
  
      $this-&gt;image-&gt;setImageResolution($DPIX,$DPIY);
  
  }
  </code></pre>