私は、さまざまなイメージファイルをWebからダウンロードし、PILを使用していくつかの処理を行うスクリプトを作成しています。このスクリプトでは、urlretreiveを使って画像を一時ファイルにダンプしていますが、今はPIL image.show()メソッドを使用してビューアで開いています。ここでは、コードの関連部分は次のとおりです。Windows上のPythonイメージングライブラリshow()
残念ながらdef main():
link_queue = Queue.Queue()
image_queue = Queue.Queue()
links = get_image_links('test_search')
for link in links:
link_queue.put(link)
for image in xrange(len(links)):
#create image downloading threads
t = ImageDownloadingThread(link_queue, image_queue)
t.setDaemon(True)
t.start()
link_queue.join()
image_data = image_queue.get()
image_file, image_url = image_data[0][0], image_data[1][0]
#get the first image downloaded and take a look
image = Image.open(image_file)
image.show()
、一時ファイルはOKロードするように思えますが(Image.openがエラーを返しません)image.show()があるとき、私は、ビューアで何も得ます呼ばれる:
私も問題の一部であったと同じ結果を得る場合には、ローカル、非テンポラリファイルを開くしようとしている。 OSはWindows Vista 32ビットSP2です。何が間違っているかもしれないかに関するアイデア?
これは既知の問題です。詳細を見つけようとしています。 –
http://stackoverflow.com/questions/4607633/image-format-to-save-in-python – cgohlke