Skip to content

Commit 0d667f5

Browse files
radarherejvanderneutstulen
authored andcommitted
Do not read "resolution" parameter if it will not be used
1 parent be48928 commit 0d667f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PIL/PdfImagePlugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def _save(im, fp, filename, save_all=False):
5353
else:
5454
existing_pdf = PdfParser.PdfParser(f=fp, filename=filename, mode="w+b")
5555

56-
x_resolution = y_resolution = im.encoderinfo.get("resolution", 72.0)
57-
5856
dpi = im.encoderinfo.get("dpi")
5957
if dpi:
6058
x_resolution = dpi[0]
6159
y_resolution = dpi[1]
60+
else:
61+
x_resolution = y_resolution = im.encoderinfo.get("resolution", 72.0)
6262

6363
info = {
6464
"title": None

0 commit comments

Comments
 (0)