title: How should I get UN-rotated JPEG image file from ghostscript?
body: <p>I am running with crazy issue in <code>ghostscript 9.15</code>.I have two commands for converting PDF to JPEG images,which has difference in height and width only.</p>
  
  <p>Command 1st </p>
  
  <blockquote>
    <p>-q -dUseCropBox -dBATCH -dDOINTERPOLATE -dMaxBitmap=300000000 -dAlignToPixels=0 -dNOPAUSE -dSAFER -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dPDFFitPage -dPrinted=false -r144 -g200x200 -sDEVICE=jpeg  -dJPEGQ=100  -sOutputFile="output.jpg" "input.pdf" -c quit</p>
  </blockquote>
  
  <p>Command 2nd </p>
  
  <blockquote>
    <p>-q -dUseCropBox -dBATCH -dDOINTERPOLATE -dMaxBitmap=300000000 -dAlignToPixels=0 -dNOPAUSE -dSAFER -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dPDFFitPage -dPrinted=false -r144 -g200x199 -sDEVICE=jpeg  -dJPEGQ=100  -sOutputFile="output.jpg" "input.pdf" -c quit</p>
  </blockquote>
  
  <p>As you can see, <strong>command has difference in -g parameter only</strong>.</p>
  
  <p>In first command I have used <code>-g200x200</code> and in second command <code>-g200x199</code>.</p>
  
  <p>First command gives rotated JPEG while second command gives UN-rotated JPEG file.Is there any utility inside ghostscript which differentiate my command from height and width perspective.</p>
  
  <p>How should I get UN-rotated JPEG image file by using same height and width<code>(-g200x200)</code> while converting PDF to JPEG image file ?</p>