A similar bug for pdftocairo was fixed in bug #94655. The ZIP archive in that bug (https://bugs.freedesktop.org/attachment.cgi?id=122468) has two files, good.pdf and bad.pdf.
Running the following command:
pdftoppm -png -singlefile -f 1 -scale-to-x 1275 -scale-to-y 1650 bad.pdf bad
creates a 1651 x 1275 png image. With those -scale-to-x/y arguments, it should be 1275 x 1651. The x and y scaling gets swapped because the PDF is internally rotated. The page dictionary specifies /Rotate 270.
Created attachment 123469 [details] [review]
[patch] Calculate rotation before scaling
This patch fixes this by moving the rotation check to before the scaling calculation.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/595.