[Tutor] transpose problems in PIL

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Mon, 6 Aug 2001 19:26:15 -0700 (PDT)


On Mon, 6 Aug 2001, Kalle Svensson wrote:

> > For some strange reason that I cannot fathom I am having difficulty with 
> > transpose() in PIL.
> [snip]
> > it gives me the error:
> > 
> > 
> > >pythonw -u card_builder.py
> > Traceback (most recent call last):
> >   File "card_builder.py", line 7, in ?
> >     clip3=clip1.transpose(Image.FLIP_RIGHT_LEFT)
> > AttributeError: FLIP_RIGHT_LEFT
> > >Exit code: 1
> > 
> > Image.ROTATE_180 works just fine. Clues?
> 
> I've never used PIL, so I'm just guesing here, but two things to check:
> 
> Could it be Image.FLIP_LEFT_RIGHT or something?
> Is it implemented in the version of PIL you're using?

According to the PIL handbook at:

    http://www.pythonware.com/library/pil/handbook/image.htm

you can do the following transposes:

    FLIP_LEFT_RIGHT
    FLIP_TOP_BOTTOM
    ROTATE_90
    ROTATE_180
    ROTATE_270


Hope this helps!