fix an image cropping bug when displaySize is specified
Summary:Diff D2647083 cleaned up image editing related logics and introduced an image cropping bug. The bug is that the result of the image cropping will be wrong if displaySize is specified. In particular, in Ads Manager App, we generate thumbnail by calling the image cropping function with displaySize set. With this bug, the thumbnail we get is not correct. This diff fixed the bug by replacing `image` with `croppedImage`. It should be a typo from D2647083 Reviewed By: zjj010104 Differential Revision: D2947730 fb-gh-sync-id: df7c7f3ddac5b053425db884f808e27b8418116e shipit-source-id: df7c7f3ddac5b053425db884f808e27b8418116e
This commit is contained in:
parent
82eeca659e
commit
914862022c
|
@ -62,8 +62,8 @@ RCT_EXPORT_METHOD(cropImage:(NSString *)imageTag
|
|||
targetSize = [RCTConvert CGSize:cropData[@"displaySize"]]; // in pixels
|
||||
RCTResizeMode resizeMode = [RCTConvert RCTResizeMode:cropData[@"resizeMode"] ?: @"contain"];
|
||||
targetRect = RCTTargetRect(croppedImage.size, targetSize, 1, resizeMode);
|
||||
transform = RCTTransformFromTargetRect(image.size, targetRect);
|
||||
croppedImage = RCTTransformImage(image, targetSize, image.scale, transform);
|
||||
transform = RCTTransformFromTargetRect(croppedImage.size, targetRect);
|
||||
croppedImage = RCTTransformImage(croppedImage, targetSize, image.scale, transform);
|
||||
}
|
||||
|
||||
// Store image
|
||||
|
|
Loading…
Reference in New Issue