code: def do_rotation(self, mirror, rot):
          
          if (not mirror and rot == 0.0):
              self.logger.debug("rotation: no rotation (nop)")
          else:
              # FIXME - with PIL one can use the transpose() method to do 90deg
              # FIXME - rotations as well as mirroring. This would be more efficient
              # FIXME - for these cases than mirror _then_ rotate.
              if (mirror):
                  self.logger.debug("rotation: mirror (about vertical axis)")
                  self.image = self.image.transpose(Image.FLIP_LEFT_RIGHT)
              if (rot != 0.0):
                  self.logger.debug("rotation: by %f degrees clockwise" % (rot))
                  self.image = self.image.rotate(-rot, expand=True)
docs: Apply rotation and/or mirroring.