Skip to content

Commit

Permalink
Fix some warning messages from XCode
Browse files Browse the repository at this point in the history
  • Loading branch information
vorjdux committed Jun 18, 2015
1 parent e358622 commit 74c548a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion RCTCamera.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
410701251ACB719800C6AA39 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0620;
LastUpgradeCheck = 0630;
TargetAttributes = {
4107012E1ACB723B00C6AA39 = {
CreatedOnToolsVersion = 6.2;
Expand Down Expand Up @@ -133,6 +133,7 @@
410701291ACB719800C6AA39 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
Expand Down
4 changes: 2 additions & 2 deletions UIImage+Resize.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

@interface UIImage (Resize)
- (UIImage *)croppedImage:(CGRect)bounds;
- (UIImage *)thumbnailImage:(NSInteger)thumbnailSize
/* TODO: - (UIImage *)thumbnailImage:(NSInteger)thumbnailSize
transparentBorder:(NSUInteger)borderSize
cornerRadius:(NSUInteger)cornerRadius
interpolationQuality:(CGInterpolationQuality)quality;
interpolationQuality:(CGInterpolationQuality)quality; */
- (UIImage *)resizedImage:(CGSize)newSize
interpolationQuality:(CGInterpolationQuality)quality;
- (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode
Expand Down
17 changes: 15 additions & 2 deletions UIImage+Resize.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode
break;

default:
[NSException raise:NSInvalidArgumentException format:@"Unsupported content mode: %d", contentMode];
[NSException raise:NSInvalidArgumentException format:@"Unsupported content mode: %ld", (long)contentMode];
}

CGSize newSize = CGSizeMake(self.size.width * ratio, self.size.height * ratio);
Expand All @@ -133,7 +133,7 @@ - (UIImage *)resizedImage:(CGSize)newSize
// Build a context that's the same dimensions as the new size
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
if((bitmapInfo == kCGImageAlphaLast) || (bitmapInfo == kCGImageAlphaNone))
bitmapInfo = kCGImageAlphaNoneSkipLast;
bitmapInfo = (CGBitmapInfo)kCGImageAlphaNoneSkipLast;

CGContextRef bitmap = CGBitmapContextCreate(NULL,
newRect.size.width,
Expand Down Expand Up @@ -163,6 +163,9 @@ - (UIImage *)resizedImage:(CGSize)newSize
return newImage;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"

// Returns an affine transform that takes into account the image orientation when drawing a scaled image
- (CGAffineTransform)transformForOrientation:(CGSize)newSize {
CGAffineTransform transform = CGAffineTransformIdentity;
Expand All @@ -185,6 +188,10 @@ - (CGAffineTransform)transformForOrientation:(CGSize)newSize {
transform = CGAffineTransformTranslate(transform, 0, newSize.height);
transform = CGAffineTransformRotate(transform, -M_PI_2);
break;
case UIImageOrientationUpMirrored:
case UIImageOrientationUp:
// TODO
break;
}

switch (self.imageOrientation) {
Expand All @@ -199,6 +206,12 @@ - (CGAffineTransform)transformForOrientation:(CGSize)newSize {
transform = CGAffineTransformTranslate(transform, newSize.height, 0);
transform = CGAffineTransformScale(transform, -1, 1);
break;
case UIImageOrientationUp:
case UIImageOrientationDown:
case UIImageOrientationLeft:
case UIImageOrientationRight:
// TODO
break;
}

return transform;
Expand Down

0 comments on commit 74c548a

Please sign in to comment.