user1555863
user1555863

Reputation: 2607

how to install libjpeg for pil on windows

I'm converting images formats on windows using python 2.7 and PIL. Trying to convert an image to JPG raises this exception:

KeyError('JPG',)

Traceback:

    ...\PIL\Image.py", line 1429, in save
    save_handler = SAVE[string.upper(format)] # unknown format
KeyError: 'JPG'

On linux, i solved this by installing the libjpeg, and setting a symbolic link to it's location so PIL could find it.

I'm trying to accomplish the same on Windows. I got the windows format package "jpegsr9.zip" from http://www.ijg.org but couldn't figure how PIL figures these files exist. Trying to place them in the same folder didn't help.

Where should i place the files so this will work on Windows as well? What is the installion process of libjpeg on Windows?

UPDATE: JPG exception isn't raised anymore if trying to convert to "JPEG" instead of "JPG" . This issue doesn't seem to require any additional installations.

Upvotes: 1

Views: 1636

Answers (1)

user1555863
user1555863

Reputation: 2607

JPG exception isn't raised anymore if trying to convert to "JPEG" instead of "JPG" . This issue doesn't seem to require any additional installations.

Upvotes: 1

Related Questions