Skip to content

Commit

Permalink
Rename ImageResizer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfNieuwenhuizen committed Aug 22, 2017
1 parent 14728cc commit abca6e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ios/RNPhotosFramework/RCTImageResizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@implementation RNPFImageResizer


bool saveImage(NSString * fullPath, UIImage * image, NSString * format, float quality)
bool RNPFsaveImage(NSString * fullPath, UIImage * image, NSString * format, float quality)
{
NSData* data = nil;
if ([format isEqualToString:@"JPEG"]) {
Expand All @@ -22,7 +22,7 @@ bool saveImage(NSString * fullPath, UIImage * image, NSString * format, float qu
return YES;
}

NSString * generateFilePath(NSString * ext, NSString *name, NSString * outputPath)
NSString * RNPFgenerateFilePath(NSString * ext, NSString *name, NSString * outputPath)
{
NSString* directory;

Expand All @@ -42,7 +42,7 @@ bool saveImage(NSString * fullPath, UIImage * image, NSString * format, float qu
return fullPath;
}

UIImage * rotateImage(UIImage *inputImage, float rotationDegrees)
UIImage * RNPFrotateImage(UIImage *inputImage, float rotationDegrees)
{

// We want only fixed 0, 90, 180, 270 degree rotations.
Expand Down Expand Up @@ -87,11 +87,11 @@ +(void) createResizedImage:(UIImage *)image

{
CGSize newSize = CGSizeMake(width, height);
NSString* fullPath = generateFilePath(@"jpg", fileName, outputPath);
NSString* fullPath = RNPFgenerateFilePath(@"jpg", fileName, outputPath);

// Rotate image if rotation is specified.
if (0 != (int)rotation) {
image = rotateImage(image, rotation);
image = RNPFrotateImage(image, rotation);
if (image == nil) {
completeBlock(@"Can't rotate the image.", @"");
return;
Expand All @@ -106,7 +106,7 @@ +(void) createResizedImage:(UIImage *)image
}

// Compress and save the image
if (!saveImage(fullPath, scaledImage, format, quality)) {
if (!RNPFsaveImage(fullPath, scaledImage, format, quality)) {
completeBlock(@"Can't save the image. Check your compression format.", @"");
return;
}
Expand Down

0 comments on commit abca6e4

Please sign in to comment.