<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Scale-to arguments not working in some cases"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94655">94655</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Scale-to arguments not working in some cases
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>utils
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bhs2007@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=122468" name="attach_122468" title="ZIP archive containing good.pdf and bad.pdf">attachment 122468</a> <a href="attachment.cgi?id=122468&action=edit" title="ZIP archive containing good.pdf and bad.pdf">[details]</a></span>
ZIP archive containing good.pdf and bad.pdf

I have encountered some strange PDF files which seem to cause pdftocairo and
pdftoppm to scale incorrectly with the -scale-to-x and -scale-to-y CLI
arguments.

I've attached two examples, good.pdf and bad.pdf, both of which consist of a
single 8.5x11" portrait page. Download each and run the following:

  pdftocairo -png -singlefile -f 1 -scale-to-x 1275 -scale-to-y 1650 bad.pdf
bad
  pdftocairo -png -singlefile -f 1 -scale-to-x 1275 -scale-to-y 1650 good.pdf
good
  file bad.png good.png

Here's the output:

  bad.png:  PNG image data, 986 x 2136, 8-bit/color RGB, non-interlaced
  good.png: PNG image data, 1275 x 1651, 8-bit/color RGB, non-interlaced

Two things to notice:

  - bad.png ended up with a resolution of 986x2136, which makes no sense given
the requested dimensions of 1275x1650.
  - good.png ended up as expected, with the exception of an extra row of pixels
(1651 vs 1650) - I think this may be a different bug.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>