fix things @Almouro has mentioned, thanks @Almouro
This commit is contained in:
parent
99563c8b32
commit
5f0bb88cef
|
@ -5,7 +5,6 @@ import android.content.ContentResolver;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Matrix;
|
||||
import android.media.ThumbnailUtils;
|
||||
import android.net.Uri;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -56,10 +55,8 @@ class ImageResizer {
|
|||
return image;
|
||||
}catch (IOException ex) {
|
||||
// No memory available for resizing.
|
||||
}catch (OutOfMemoryError ex) {
|
||||
// No memory available for resizing.
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -112,7 +109,7 @@ class ImageResizer {
|
|||
|
||||
public static String createResizedImage(Context context, String imagePath, int newWidth,
|
||||
int newHeight, Bitmap.CompressFormat compressFormat,
|
||||
int quality, int rotation) throws IOException{
|
||||
int quality, int rotation) throws IOException {
|
||||
|
||||
Bitmap resizedImage = ImageResizer.rotateImage(ImageResizer.resizeImage(imagePath, newWidth, newHeight,context), rotation);
|
||||
return ImageResizer.saveImage(resizedImage, context.getCacheDir(),
|
||||
|
|
|
@ -44,7 +44,6 @@ RCT_EXPORT_METHOD(createResizedImage:(NSString *)path
|
|||
|
||||
[_bridge.imageLoader loadImageWithTag:path callback:^(NSError *error, UIImage *image) {
|
||||
if (error || image == nil) {
|
||||
UIImage* image;
|
||||
if ([path hasPrefix:@"data:"] || [path hasPrefix:@"file:"]) {
|
||||
NSURL *imageUrl = [[NSURL alloc] initWithString:path];
|
||||
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:imageUrl]];
|
||||
|
|
Loading…
Reference in New Issue