[Image-SIG] import ICCProfile Error

Bharathwaaj Srinivasan bharathwaaj.s at gmail.com
Sun Nov 14 18:44:44 CET 2010


As you suggested, I've commented out the try except code

        #try:
        #    import ICCProfile
        #    p = ICCProfile.ICCProfile(im.info["icc_profile"])
        #    name = p.tags.desc.get("ASCII", p.tags.desc.get("Unicode",
p.tags.desc.get("Macintosh", p.tags.desc.get("en", {}).get("US", "ICC
Profile")))).encode("latin1", "replace")[:79]
        #except ImportError:
        name = "ICC Profile"

and it works fine. Still couldn't understand why it was failing?

Kind regards,
Bharath

On 14 November 2010 22:26, Fredrik Lundh <fredrik at pythonware.com> wrote:

> On Sun, Nov 14, 2010 at 3:46 PM, Bharathwaaj Srinivasan
> <bharathwaaj.s at gmail.com> wrote:
> > Hi,
> >
> > I tried from the command line. Still getting error. Please see the log.
> >
> > bharath at bharath-laptop:~/workspace/webKit$ python2.5
> > Python 2.5.5 (r255:77872, Nov  3 2010, 13:18:19)
> > [GCC 4.4.5] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import PIL
> >>>> import ICCProfile
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > ImportError: No module named ICCProfile
> >>>> from PIL import ICCProfile
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > ImportError: cannot import name ICCProfile
> >>>>
>
> That's irrelevant -- in the PNG module, the import is wrapped inside a
> try/except statement.  The problem is that the try/except expects an
> ImportError (which you'e seeing), not a SystemError (which is what
> happens inside GAE).
>
> </F>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20101114/020cc1e4/attachment.html>


More information about the Image-SIG mailing list