astrofrog / pyavm

Pure-python AVM library
http://astrofrog.github.io/pyavm/
Other
20 stars 9 forks source link

Embedding AVM #2

Closed ebressert closed 13 years ago

ebressert commented 13 years ago

When embedding an AVM file in an image, the process corrupts PIL (latest EPD package) from reading it. An error of the output is below. I test this on JPG, PNG and TIFF format files. Additionally, ImageMagick makes a note of the corruption when it converts the images to another format (convert: Corrupt JPEG data: 3 extraneous bytes before marker 0xe0 `image.jpg' @ warning/jpeg.c/EmitMessage/230.)

In [18]: g = Image.open('image.tif')

IOError Traceback (most recent call last)

/Users/eli/Desktop/ in ()

/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/site-packages/PIL/Image.py in open(fp, mode) 1978 pass 1979 -> 1980 raise IOError("cannot identify image file") 1981 1982 #

IOError: cannot identify image file

astrofrog commented 13 years ago

This was due to unicode issues. Can you try updating to the latest version and trying again?

ebressert commented 13 years ago

Hi Tom,

Yikes, meant to post on the pyavm github page. Sorry about that. Yes, the problem is fixed. But we should still add an Equinox assumption (if missing) for the APLpy module. Here's a link to a JPG image that does not have the Equinox field: http://www.spitzer.caltech.edu/uploaded_files/images/0003/5178/sig06-027.jpg

astrofrog commented 13 years ago

The equinox issue is fixed with the latest version - can you try? That JPG plots fine now.