Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d593ea

Browse files
committed

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

‎lib/matplotlib/testing/compare.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
importnumpyasnp
1919
fromPILimportImage
20+
importpackaging.version
2021

2122
importmatplotlibasmpl
2223
frommatplotlibimportcbook
@@ -56,7 +57,7 @@ def get_file_hash(path, block_size=2 ** 20):
5657

5758
ifPath(path).suffix=='.pdf':
5859
sha256.update(str(mpl._get_executable_info("gs").version).encode('utf-8'))
59-
sha256.update(b"r600")# invalidate old cache entries
60+
sha256.update(b"antialiasing")# invalidate old cache entries
6061
elifPath(path).suffix=='.svg':
6162
sha256.update(str(mpl._get_executable_info("inkscape").version).encode('utf-8'))
6263

@@ -111,14 +112,21 @@ def __call__(self, orig, dest):
111112
class_GSConverter(_Converter):
112113
def__call__(self,orig,dest):
113114
ifnotself._proc:
115+
ifmpl._get_executable_info("gs").version<packaging.version.parse("9.57"):
116+
antialias= [
117+
"-sDEVICE=png16m",
118+
"-r150",
119+
"-dGraphicsAlphaBits=4",
120+
"-dTextAlphaBits=4",
121+
]
122+
else:
123+
antialias= ["-sDEVICE=png16malpha","-r600","-dDownScaleFactor=4"]
114124
self._proc=subprocess.Popen(
115125
[mpl._get_executable_info("gs").executable,
116126
"-dNOSAFER",
117127
"-dNOPAUSE",
118128
"-dEPSCrop",
119-
"-sDEVICE=png16malpha",
120-
"-r600",
121-
"-dDownScaleFactor=4"],
129+
*antialias],
122130
# As far as I can see, ghostscript never outputs to stderr.
123131
stdin=subprocess.PIPE,stdout=subprocess.PIPE)
124132
try:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp