I imported "image" and tried image.Decode() but all I got was an "image:
unknown format" error.
According to the image.Decode() docs:
"Decode decodes an image that has been encoded in a registered
format. ... Format registration is typically done by the init method
of the codec-specific package"
So then I tried importing "image/png" and "image/jpg" since the images
I'm using are in one or other of these formats. But now of course I get
an "imported and not used: image/png" error since I don't explicitly use
anything from their APIs.
Or should I just check the file extension and use the png.Decode() or
jpg.Decode() methods as appropriate?
Thanks!
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Advanced Qt Programming" - ISBN 0321635906
http://www.qtrac.eu/aqpbook.html
Try
import _ "image/png"
This will give you the side effect of importing, but you can avoid
"not used" errors.
- Evan
Thanks, that worked like a charm.