回答編集履歴

1

動作検証

2018/05/23 07:00

投稿

can110
can110

スコア38266

test CHANGED
@@ -11,3 +11,83 @@
11
11
  [subprocess.check_call(command, stdin=devnull, stdout=devnull)](https://github.com/python-pillow/Pillow/blob/07b657203dfc0866e9c9760a49d3d1c50fa531ac/src/PIL/EpsImagePlugin.py#L144)
12
12
 
13
13
  におけるコマンド呼出に失敗しています。
14
+
15
+
16
+
17
+
18
+
19
+ ## 動作検証
20
+
21
+
22
+
23
+ `Win10(WSL)`上の`Ubuntu 16.04.4`にて[football_logo.eps](http://people.sc.fsu.edu/~jburkardt/data/eps/football_logo.eps)で試してみましたが、問題なく動作しました。
24
+
25
+
26
+
27
+ ```.sh
28
+
29
+ $ python -V
30
+
31
+ Python 2.7.15 :: Anaconda custom (64-bit)
32
+
33
+ $ pip show pillow
34
+
35
+ Version: 5.1.0
36
+
37
+ $ pip show reportlab
38
+
39
+ $ (未インストール)
40
+
41
+ $ which gs
42
+
43
+ /usr/bin/gs
44
+
45
+ ```
46
+
47
+
48
+
49
+ ちなみに`.eps`ファイルが存在しない場合は提示とは異なるエラーとなりました。
50
+
51
+ `gs`が未インストール、またはパスが通っていないなどが原因かもしれません。
52
+
53
+
54
+
55
+ ```Python
56
+
57
+ from PIL import Image
58
+
59
+ img = Image.open('football_logo.eps')
60
+
61
+ print img.info
62
+
63
+ """
64
+
65
+ {'Title': '(football_seal.eps)', 'Pages': '1', 'Creator': '(ImageMagick)', 'Docu
66
+
67
+ mentData': 'Clean7Bit', 'LanguageLevel': '1', 'BoundingBox': '0 0 350 350', 'Cre
68
+
69
+ ationDate': '(Sat Apr 7 11:01:34 2007)', 'PS-Adobe': '3.0 EPSF-3.0'}
70
+
71
+ """
72
+
73
+ img.save('football_logo.png') # OK
74
+
75
+
76
+
77
+ # 存在しないファイルを指定するとImage.pyでエラー
78
+
79
+ img = Image.open('football_logo2.eps')
80
+
81
+ """
82
+
83
+ File "~lib/python2.7/site-packages/PIL/Image.py
84
+
85
+ ", line 2548, in open
86
+
87
+ fp = builtins.open(filename, "rb")
88
+
89
+ IOError: [Errno 2] No such file or directory: 'football_logo2.eps'
90
+
91
+ """
92
+
93
+ ```