[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG: pygame.image.save and tiff files.



Marcus von Appen wrote:
On, Tue Jan 29, 2008, Rene Dudfield wrote:

I think it would be possible to add tiff write support... since we
link with libtiff.  Much in the same way png, and jpg writing is
supported.

I guess we should add .jpeg detection to there as well.


jpeg detection was already implemented, but the checks might not work in
any case. I'm working on it currently.

Lenard: Did you use some special file magic or a some simple stuff like
pygame.image.save ("bla.jpeg")? And can you recheck, whether the
pygame.imageext module is properly installed and works for you? It's
used by pygame for jpeg and png saving.

I thought I had posted this issue before but could not find the message. I tried it again and both jpg and jpeg endings work properly for load and save. I guess I had accidentally used an mpeg ending or something in my original test. So it is a false alarm.

For reference here was my latest test:

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pygame import *
>>> s = image.load('static.png')
>>> s
<Surface(141x68x24 SW)>
>>> image.save(s, 'xxx.jpg')
>>> image.save(s, 'xxx.jpeg')
>>> a = image.load('xxx.jpg')
>>> b = image.load('xxx.jpeg')
>>> buffer(a.get_buffer())[:] == buffer(b.get_buffer())[:]
True
>>> buffer(a.get_buffer())[:] == buffer(s.get_buffer())[:]
False

--
Lenard Lindstrom
<len-l@xxxxxxxxx>