          switch (image.imageOrientation) {         case UIImageOrientationDown:         case UIImageOrientationDownMirrored:             transform = CGAffineTransformTranslate(transform, image.size.width, image.size.height);             transform = CGAffineTransformRotate(transform, M_PI);             break;                      case UIImageOrientationLeft:         case UIImageOrientationLeftMirrored:             transform = CGAffineTransformTranslate(transform, image.size.width, 0);             transform = CGAffineTransformRotate(transform, M_PI