File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -85,17 +85,13 @@ def __init__(self, fig):
8585 stderr = subprocess .STDOUT
8686 ).decode ('utf-8' )
8787 # Extract page size
88- dims = None
89- for line in pdfinfo_out .split ('\n ' ):
90- # Page size: 195.106 x 156.239 pts
91- m = re .match (
92- 'Page size: *([0-9]+\.[0-9]+) x ([0-9]+\.[0-9]+) pts' ,
93- line
94- )
95- if m :
96- # get dims in inches
97- dims = [float (m .group (1 )) / 72 , float (m .group (2 )) / 72 ]
98- break
88+ # Page size: 195.106 x 156.239 pts
89+ m = re .search (
90+ 'Page size: *([0-9]+\.[0-9]+) x ([0-9]+\.[0-9]+) pts' ,
91+ pdfinfo_out
92+ )
93+ # get dims in inches
94+ dims = [float (m .group (1 )) / 72 , float (m .group (2 )) / 72 ]
9995 assert dims is not None
10096 max_num_pixels = 89e6
10197 max_dpi = math .sqrt (max_num_pixels / dims [0 ] / dims [1 ])
You can’t perform that action at this time.
0 commit comments