title: ImageMagick doesn't change resolution on picture
body: <p>I have a project where I have a hotfolder system in place where I drop a file in a folder and it executes an PHP script that does some magic on the file with ImageMagick. </p>
  
  <p>One of the operations I want to do with ImageMagick is the simple process to change the resolution of a picture.</p>
  
  <p>What I want to do is to get the picture in 72 DPI resolution. This is part of my code:</p>
  
  <pre><code>$im = new Imagick();
  $im-&gt;setResolution(72,72);
  $im-&gt;readimage($xmlConfig-&gt;general-&gt;input); //Input is TIF 300 DPI
  $im-&gt;setImageUnits(imagick::RESOLUTION_PIXELSPERINCH);
  $im-&gt;setImageResolution(72,72);
  $im-&gt;resampleImage(72,72,imagick::FILTER_UNDEFINED,0);
  $im-&gt;setimageformat($xmlConfig-&gt;extension); //added in EDIT
  $im-&gt;writeimage($xmlConfig-&gt;general-&gt;output); //Output is also 300 DPI Filename is something.jpg added in EDIT
  $im-&gt;destroy();
  </code></pre>
  
  <p>So, what am I doing wrong? Because I cannot get this to work. I have tried all combinations available to try to get this correct and also googling this as a maniac and still do not get the result I want.</p>
  
  <p>**Edit:* I noticed when I did some testing that this actually works. But its when I add the part with <code>setimageformat</code> to JPEG and set the filename to <em>something.jpg</em> that it goes wrong. </p>
  
  <p>The JPEG is always 300 DPI even if I have specified 72 above.</p>