mirror of
https://github.com/status-im/react-native-image-crop-picker.git
synced 2025-02-23 02:48:12 +00:00
Merge pull request #381 from Howard-Wang-Hao/master
[iOS] Fix a bug that cause a {0,0} size image
This commit is contained in:
commit
391465efcc
@ -34,8 +34,11 @@
|
||||
NSNumber *maxWidth = [options valueForKey:@"compressImageMaxWidth"];
|
||||
NSNumber *maxHeight = [options valueForKey:@"compressImageMaxHeight"];
|
||||
ImageResult *result = [[ImageResult alloc] init];
|
||||
|
||||
if ([maxWidth integerValue] == 0 || [maxWidth integerValue] == 0) {
|
||||
|
||||
//[origin] if ([maxWidth integerValue] == 0 || [maxHeight integerValue] == 0) {
|
||||
//when pick a width< height image and only set "compressImageMaxWidth",will cause a {0,0}size image
|
||||
//Now fix it
|
||||
if ([maxWidth integerValue] == 0 || [maxHeight integerValue] == 0) {
|
||||
result.width = [NSNumber numberWithFloat:image.size.width];
|
||||
result.height = [NSNumber numberWithFloat:image.size.height];
|
||||
result.image = image;
|
||||
|
Loading…
x
Reference in New Issue
Block a user