From c7f56d0f7ff41fdb99c1e97f447e5aa843e7d9ef Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 2 Jun 2009 17:47:08 +0000 Subject: [Author: altse] Add category extension to UIImage to allow resizing while preserving aspect ratios and optional image clipping. R=thomasvl,dmaclach DELTA=507 (507 added, 0 deleted, 0 changed) --- iPhone/GTMUIImage+Resize.h | 40 ++++ iPhone/GTMUIImage+Resize.m | 100 ++++++++ iPhone/GTMUIImage+ResizeTest.m | 256 +++++++++++++++++++++ iPhone/TestData/GTMUIImage+Resize_100x100.png | Bin 0 -> 1298 bytes .../GTMUIImage+Resize_100x100_to_40x60.png | Bin 0 -> 234 bytes .../GTMUIImage+Resize_100x100_to_50x50.png | Bin 0 -> 261 bytes .../GTMUIImage+Resize_100x100_to_60x40.png | Bin 0 -> 237 bytes iPhone/TestData/GTMUIImage+Resize_100x50.png | Bin 0 -> 1120 bytes .../GTMUIImage+Resize_100x50_to_40x60_clip.png | Bin 0 -> 184 bytes .../GTMUIImage+Resize_100x50_to_40x60_noclip.png | Bin 0 -> 126 bytes .../GTMUIImage+Resize_100x50_to_50x50_clip.png | Bin 0 -> 214 bytes .../GTMUIImage+Resize_100x50_to_50x50_noclip.png | Bin 0 -> 151 bytes .../GTMUIImage+Resize_100x50_to_60x40_clip.png | Bin 0 -> 196 bytes .../GTMUIImage+Resize_100x50_to_60x40_noclip.png | Bin 0 -> 163 bytes iPhone/TestData/GTMUIImage+Resize_50x100.png | Bin 0 -> 1196 bytes .../GTMUIImage+Resize_50x100_to_40x60_clip.png | Bin 0 -> 196 bytes .../GTMUIImage+Resize_50x100_to_40x60_noclip.png | Bin 0 -> 196 bytes .../GTMUIImage+Resize_50x100_to_50x50_clip.png | Bin 0 -> 218 bytes .../GTMUIImage+Resize_50x100_to_50x50_noclip.png | Bin 0 -> 158 bytes .../GTMUIImage+Resize_50x100_to_60x40_clip.png | Bin 0 -> 196 bytes .../GTMUIImage+Resize_50x100_to_60x40_noclip.png | Bin 0 -> 145 bytes 21 files changed, 396 insertions(+) create mode 100644 iPhone/GTMUIImage+Resize.h create mode 100644 iPhone/GTMUIImage+Resize.m create mode 100644 iPhone/GTMUIImage+ResizeTest.m create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x100.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x100_to_40x60.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x100_to_50x50.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x100_to_60x40.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_clip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_noclip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_clip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_noclip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_clip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_noclip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_clip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_noclip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_clip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_noclip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_clip.png create mode 100644 iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_noclip.png (limited to 'iPhone') diff --git a/iPhone/GTMUIImage+Resize.h b/iPhone/GTMUIImage+Resize.h new file mode 100644 index 0000000..25e2125 --- /dev/null +++ b/iPhone/GTMUIImage+Resize.h @@ -0,0 +1,40 @@ +// +// GTMUIImage+Resize.h +// +// Copyright 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import + +@interface UIImage (GTMUIImageResizeAdditions) + +// Returns an image resized to |targetSize|. +// +// If |preserveAspectRatio| is YES, the original image aspect ratio is +// preserved. +// +// When |preserveAspectRatio| is YES and if |targetSize|'s aspect ratio +// is different from the image, the resulting image will be shrunken to +// a size that is within |targetSize|. +// +// To preserve the |targetSize| when |preserveAspectRatio| is YES, set +// |trimToFit| to YES. The resulting image will be the largest proportion +// of the receiver that fits in the targetSize, aligned to center of the image. +// +// Image interpolation level for resizing is set to kCGInterpolationDefault. +- (UIImage *)gtm_imageByResizingToSize:(CGSize)targetSize + preserveAspectRatio:(BOOL)preserveAspectRatio + trimToFit:(BOOL)trimToFit; +@end diff --git a/iPhone/GTMUIImage+Resize.m b/iPhone/GTMUIImage+Resize.m new file mode 100644 index 0000000..f93a521 --- /dev/null +++ b/iPhone/GTMUIImage+Resize.m @@ -0,0 +1,100 @@ +// +// GTMUIImage+Resize.m +// +// Copyright 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import "GTMUIImage+Resize.h" + +@implementation UIImage (GTMUIImageResizeAdditions) + +- (UIImage *)gtm_imageByResizingToSize:(CGSize)targetSize + preserveAspectRatio:(BOOL)preserveAspectRatio + trimToFit:(BOOL)trimToFit { + CGSize imageSize = [self size]; + if (imageSize.height < 1 || imageSize.width < 1) { + return nil; + } + if (targetSize.height < 1 || targetSize.width < 1) { + return nil; + } + CGFloat aspectRatio = imageSize.width / imageSize.height; + CGFloat targetAspectRatio = targetSize.width / targetSize.height; + + CGRect projectTo = CGRectZero; + if (preserveAspectRatio) { + if (trimToFit) { + // Scale and clip image so that the aspect ratio is preserved and the + // target size is filled. + if (targetAspectRatio < aspectRatio) { + // clip the x-axis. + projectTo.size.width = targetSize.height * aspectRatio; + projectTo.size.height = targetSize.height; + projectTo.origin.x = (targetSize.width - projectTo.size.width) / 2; + projectTo.origin.y = 0; + } else { + // clip the y-axis. + projectTo.size.width = targetSize.width; + projectTo.size.height = targetSize.width / aspectRatio; + projectTo.origin.x = 0; + projectTo.origin.y = (targetSize.height - projectTo.size.height) / 2; + } + } else { + // Scale image to ensure it fits inside the specified targetSize. + if (targetAspectRatio < aspectRatio) { + // target is less wide than the original. + projectTo.size.width = targetSize.width; + projectTo.size.height = projectTo.size.width / aspectRatio; + targetSize = projectTo.size; + } else { + // target is wider than the original. + projectTo.size.height = targetSize.height; + projectTo.size.width = projectTo.size.height * aspectRatio; + targetSize = projectTo.size; + } + } // if (clip) + } else { + // Don't preserve the aspect ratio. + projectTo.size = targetSize; + } + + projectTo = CGRectIntegral(projectTo); + // There's no CGSizeIntegral, so we fake our own. + CGRect integralRect = CGRectZero; + integralRect.size = targetSize; + targetSize = CGRectIntegral(integralRect).size; + + // iPhone recommended settings. + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGBitmapInfo bitmapInfo = (kCGBitmapByteOrder32Little | + kCGImageAlphaPremultipliedFirst); + + CGContextRef context = CGBitmapContextCreate(nil, // data + targetSize.width, + targetSize.height, + 8, // bitsPerPixel + 0, // bytesPerRow + colorSpace, + bitmapInfo); + CGColorSpaceRelease(colorSpace); + // Produce the image + CGContextDrawImage(context, projectTo, [self CGImage]); + CGImageRef resizedRef = CGBitmapContextCreateImage(context); + CGContextRelease(context); + UIImage *resized = [UIImage imageWithCGImage:resizedRef]; + CGImageRelease(resizedRef); + return resized; +} +@end diff --git a/iPhone/GTMUIImage+ResizeTest.m b/iPhone/GTMUIImage+ResizeTest.m new file mode 100644 index 0000000..4678511 --- /dev/null +++ b/iPhone/GTMUIImage+ResizeTest.m @@ -0,0 +1,256 @@ +// +// GTMUIImage+ResizeTest.m +// +// Copyright 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import "GTMNSObject+UnitTesting.h" +#import "GTMSenTestCase.h" +#import "GTMUIImage+Resize.h" + +#define GTMUIImageResizeAssertImageEqual(imageObject, imageSuffix) \ + GTMAssertObjectImageEqualToImageNamed(imageObject, \ + @"GTMUIImage+Resize_" imageSuffix,\ + @"Resized image mismatched.") + +@interface GTMUIImage_ResizeTest : SenTestCase +@end + +@implementation GTMUIImage_ResizeTest + +- (void)testNilImage { + UIImage *image = [[UIImage alloc] init]; + UIImage *actual = [image gtm_imageByResizingToSize:CGSizeMake(100, 100) + preserveAspectRatio:YES + trimToFit:NO]; + STAssertNil(actual, @"Invalid inputs should return nil"); +} + +- (void)testInvalidInput { + UIImage *actual; + UIImage *image + = [UIImage imageNamed:@"GTMUIImage+Resize_100x50.png"]; + actual = [image gtm_imageByResizingToSize:CGSizeZero + preserveAspectRatio:YES + trimToFit:NO]; + STAssertNil(actual, @"CGSizeZero resize should be ignored."); + + actual = [image gtm_imageByResizingToSize:CGSizeMake(0.1, 0.1) + preserveAspectRatio:YES + trimToFit:NO]; + STAssertNil(actual, @"Invalid size should be ignored."); + + actual = [image gtm_imageByResizingToSize:CGSizeMake(-100, -100) + preserveAspectRatio:YES + trimToFit:NO]; + STAssertNil(actual, @"Invalid size should be ignored."); +} + +- (void)testImageByResizingWithoutPreservingAspectRatio { + UIImage *actual = nil; + // Square image. + UIImage *originalImage + = [UIImage imageNamed:@"GTMUIImage+Resize_100x100.png"]; + STAssertNotNil(originalImage, @"Unable to read image."); + + // Resize with same aspect ratio. + CGSize size50x50 = CGSizeMake(50, 50); + actual = [originalImage gtm_imageByResizingToSize:size50x50 + preserveAspectRatio:NO + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], size50x50), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size50x50), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x100_to_50x50"); + + // Resize with different aspect ratio + CGSize size60x40 = CGSizeMake(60, 40); + actual = [originalImage gtm_imageByResizingToSize:size60x40 + preserveAspectRatio:NO + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], size60x40), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size60x40), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x100_to_60x40"); + + CGSize size40x60 = CGSizeMake(40, 60); + actual = [originalImage gtm_imageByResizingToSize:size40x60 + preserveAspectRatio:NO + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], size40x60), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size40x60), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x100_to_40x60"); +} + +- (void)testImageByResizingPreservingAspectRatioWithoutClip { + UIImage *actual = nil; + UIImage *landscapeImage = + [UIImage imageNamed:@"GTMUIImage+Resize_100x50.png"]; + STAssertNotNil(landscapeImage, @"Unable to read image."); + + // Landscape resize to 50x50, but clipped to 50x25. + CGSize size50x50 = CGSizeMake(50, 50); + CGSize expected50x25 = CGSizeMake(50, 25); + actual = [landscapeImage gtm_imageByResizingToSize:size50x50 + preserveAspectRatio:YES + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], expected50x25), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(expected50x25), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x50_to_50x50_noclip"); + + // Landscape resize to 60x40, but clipped to 60x30. + CGSize size60x40 = CGSizeMake(60, 40); + CGSize expected60x30 = CGSizeMake(60, 30); + + actual = [landscapeImage gtm_imageByResizingToSize:size60x40 + preserveAspectRatio:YES + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], expected60x30), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(expected60x30), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x50_to_60x40_noclip"); + + // Landscape resize to 40x60, but clipped to 40x20. + CGSize expected40x20 = CGSizeMake(40, 20); + CGSize size40x60 = CGSizeMake(40, 60); + actual = [landscapeImage gtm_imageByResizingToSize:size40x60 + preserveAspectRatio:YES + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], expected40x20), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(expected40x20), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x50_to_40x60_noclip"); + + // Portrait Image + UIImage *portraitImage = + [UIImage imageNamed:@"GTMUIImage+Resize_50x100.png"]; + + // Portrait resize to 50x50, but clipped to 25x50. + CGSize expected25x50 = CGSizeMake(25, 50); + actual = [portraitImage gtm_imageByResizingToSize:size50x50 + preserveAspectRatio:YES + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], expected25x50), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(expected25x50), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"50x100_to_50x50_noclip"); + + // Portrait resize to 60x40, but clipped to 20x40. + CGSize expected20x40 = CGSizeMake(20, 40); + actual = [portraitImage gtm_imageByResizingToSize:size60x40 + preserveAspectRatio:YES + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], expected20x40), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(expected20x40), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"50x100_to_60x40_noclip"); + + // Portrait resize to 40x60, but clipped to 30x60. + CGSize expected30x60 = CGSizeMake(30, 60); + actual = [portraitImage gtm_imageByResizingToSize:size40x60 + preserveAspectRatio:YES + trimToFit:NO]; + STAssertTrue(CGSizeEqualToSize([actual size], expected30x60), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(expected30x60), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"50x100_to_40x60_noclip"); +} + +- (void)testImageByResizingPreservingAspectRatioWithClip { + UIImage *actual = nil; + UIImage *landscapeImage = + [UIImage imageNamed:@"GTMUIImage+Resize_100x50.png"]; + STAssertNotNil(landscapeImage, @"Unable to read image."); + + // Landscape resize to 50x50 + CGSize size50x50 = CGSizeMake(50, 50); + actual = [landscapeImage gtm_imageByResizingToSize:size50x50 + preserveAspectRatio:YES + trimToFit:YES]; + STAssertTrue(CGSizeEqualToSize([actual size], size50x50), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size50x50), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x50_to_50x50_clip"); + + // Landscape resize to 60x40 + CGSize size60x40 = CGSizeMake(60, 40); + actual = [landscapeImage gtm_imageByResizingToSize:size60x40 + preserveAspectRatio:YES + trimToFit:YES]; + STAssertTrue(CGSizeEqualToSize([actual size], size60x40), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size60x40), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x50_to_60x40_clip"); + + // Landscape resize to 40x60 + CGSize size40x60 = CGSizeMake(40, 60); + actual = [landscapeImage gtm_imageByResizingToSize:size40x60 + preserveAspectRatio:YES + trimToFit:YES]; + STAssertTrue(CGSizeEqualToSize([actual size], size40x60), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size40x60), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"100x50_to_40x60_clip"); + + // Portrait Image. + UIImage *portraitImage = + [UIImage imageNamed:@"GTMUIImage+Resize_50x100.png"]; + + // Portrait resize to 50x50 + actual = [portraitImage gtm_imageByResizingToSize:size50x50 + preserveAspectRatio:YES + trimToFit:YES]; + STAssertTrue(CGSizeEqualToSize([actual size], size50x50), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size50x50), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"50x100_to_50x50_clip"); + + // Portrait resize to 60x40 + actual = [portraitImage gtm_imageByResizingToSize:size60x40 + preserveAspectRatio:YES + trimToFit:YES]; + STAssertTrue(CGSizeEqualToSize([actual size], size60x40), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size60x40), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"50x100_to_60x40_clip"); + + // Portrait resize to 40x60. + actual = [portraitImage gtm_imageByResizingToSize:size40x60 + preserveAspectRatio:YES + trimToFit:YES]; + STAssertTrue(CGSizeEqualToSize([actual size], size40x60), + @"Resized image should equal size: %@ actual: %@", + NSStringFromCGSize(size40x60), + NSStringFromCGSize([actual size])); + GTMUIImageResizeAssertImageEqual(actual, @"50x100_to_40x60_clip"); +} + +@end diff --git a/iPhone/TestData/GTMUIImage+Resize_100x100.png b/iPhone/TestData/GTMUIImage+Resize_100x100.png new file mode 100644 index 0000000..93a4a38 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x100.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x100_to_40x60.png b/iPhone/TestData/GTMUIImage+Resize_100x100_to_40x60.png new file mode 100644 index 0000000..10223fd Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x100_to_40x60.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x100_to_50x50.png b/iPhone/TestData/GTMUIImage+Resize_100x100_to_50x50.png new file mode 100644 index 0000000..ab71afb Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x100_to_50x50.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x100_to_60x40.png b/iPhone/TestData/GTMUIImage+Resize_100x100_to_60x40.png new file mode 100644 index 0000000..5683f17 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x100_to_60x40.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50.png b/iPhone/TestData/GTMUIImage+Resize_100x50.png new file mode 100644 index 0000000..8681e02 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_clip.png b/iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_clip.png new file mode 100644 index 0000000..b7721ad Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_clip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_noclip.png b/iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_noclip.png new file mode 100644 index 0000000..0e2c9de Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50_to_40x60_noclip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_clip.png b/iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_clip.png new file mode 100644 index 0000000..e913bfb Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_clip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_noclip.png b/iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_noclip.png new file mode 100644 index 0000000..365dfb6 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50_to_50x50_noclip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_clip.png b/iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_clip.png new file mode 100644 index 0000000..b8e6c06 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_clip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_noclip.png b/iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_noclip.png new file mode 100644 index 0000000..14d96b0 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_100x50_to_60x40_noclip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100.png b/iPhone/TestData/GTMUIImage+Resize_50x100.png new file mode 100644 index 0000000..adf8c22 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_clip.png b/iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_clip.png new file mode 100644 index 0000000..3c68940 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_clip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_noclip.png b/iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_noclip.png new file mode 100644 index 0000000..8a9b227 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100_to_40x60_noclip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_clip.png b/iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_clip.png new file mode 100644 index 0000000..6d6a5df Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_clip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_noclip.png b/iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_noclip.png new file mode 100644 index 0000000..c79873a Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100_to_50x50_noclip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_clip.png b/iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_clip.png new file mode 100644 index 0000000..87feb9b Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_clip.png differ diff --git a/iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_noclip.png b/iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_noclip.png new file mode 100644 index 0000000..be94dc6 Binary files /dev/null and b/iPhone/TestData/GTMUIImage+Resize_50x100_to_60x40_noclip.png differ -- cgit v1.2.3