Thank you very much for your answers, So, it seems that pyglet can read .dds, but not save to this format. Indeed, I had looked in dds.py. I found a decoder (DDSImageDecoder), but no trace of an encoder. Neither in pil.py or s3tc.py. So I wondered if the encoder was somewhere else.
Thank you again for your great reactivity. Regards, Vincent PS : Anyway I'll work with the last Pyglet version, thanks for the tip! PS 2 : the output of get_encoders() : [<pyglet.image.codecs.pil.PILImageEncoder object at 0x279da10>, <pyglet.image.codecs.png.PNGImageEncoder object at 0x279da50>] Le mercredi 9 avril 2014 13:20:00 UTC+2, Vincent Damoy a écrit : > > Hello, > > I'm working on Ubuntu 12.04, with Python 2.7 and Pyglet 1.1.4 (the ubuntu > repository version) > I'm trying to create a small python script to browse images in a folder > and transform it in another format. (I joined it to this mail). > I've modified the image_convert.py example, which I found in the pyglet's > examples folder. > > The script works well with several image formats (JPG-> PNG, PNG->JPG...), > except if I want to transform pictures in DDS. > In this case, pyglet returns an exception : > > -------------------------------------------------------------------- > Traceback (most recent call last): > File "image_convert_travail.py", line 40, in <module> > convert(folder) > File "image_convert_travail.py", line 25, in convert > image.save(namefile+'.dds') > File "/usr/lib/pymodules/python2.7/pyglet/image/__init__.py", line 442, > in save > encoder.encode(self, file, filename) > File "/usr/lib/pymodules/python2.7/pyglet/image/codecs/pil.py", line > 104, in encode > raise ImageEncodeException(e) > pyglet.image.codecs.ImageEncodeException: 'DDS' > -------------------------------------------------------------------- > > I understand that pyglet doesn't find the DDS encoder. > Do you know where it is? (I didn't find it in pyglet files) > Does it exist in Linux package? (a friend of mine succeeded to encode a > DDS file with the original script, but he works under windows) > Or may be "image.save(namefile+'.dds')" is not sufficient... Should I > compress the texture before saving it in dds format? > > Thanks for any reply. > All the best. > Vincent > > > > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
