diff --git a/android/src/newarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java b/android/src/newarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java index 4929f782..0ce1a8fa 100644 --- a/android/src/newarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java +++ b/android/src/newarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java @@ -11,7 +11,6 @@ import com.facebook.react.bridge.ReadableMap; public class RNPhotoManipulatorModule extends NativeRNPhotoManipulatorSpec { - public static final String NAME = "RNPhotoManipulator"; private final RNPhotoManipulatorModuleImpl implement; public RNPhotoManipulatorModule(ReactApplicationContext reactContext) { diff --git a/android/src/oldarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java b/android/src/oldarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java index adfdd3a7..045f2d8f 100644 --- a/android/src/oldarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java +++ b/android/src/oldarch/com/guhungry/rnphotomanipulator/RNPhotoManipulatorModule.java @@ -1,10 +1,5 @@ - package com.guhungry.rnphotomanipulator; -import android.graphics.Bitmap; -import android.graphics.Paint; -import android.graphics.PointF; -import android.graphics.Typeface; import androidx.annotation.Nullable; import com.facebook.react.bridge.Promise; @@ -13,21 +8,8 @@ import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.views.text.ReactFontManager; -import com.facebook.react.module.annotations.ReactModule; -import com.guhungry.photomanipulator.BitmapUtils; -import com.guhungry.photomanipulator.MimeUtils; -import com.guhungry.rnphotomanipulator.utils.ImageUtils; -import com.guhungry.rnphotomanipulator.utils.ParamUtils; - -import java.util.HashMap; -import java.util.Map; -@ReactModule(name = RNPhotoManipulatorModule.NAME) public class RNPhotoManipulatorModule extends ReactContextBaseJavaModule { - public static final String NAME = "RNPhotoManipulator"; - private final String FILE_PREFIX = "RNPM_"; - private final int DEFAULT_QUALITY = 100; private final RNPhotoManipulatorModuleImpl implement; public RNPhotoManipulatorModule(ReactApplicationContext reactContext) { @@ -68,15 +50,5 @@ public void printText(String uri, ReadableArray list, String mimeType, Promise p @ReactMethod public void optimize(String uri, double quality, Promise promise) { implement.optimize(uri, quality, promise); - try { - Bitmap output = ImageUtils.bitmapFromUri(getReactApplicationContext(), uri); - - String file = ImageUtils.saveTempFile(getReactApplicationContext(), output, MimeUtils.JPEG, FILE_PREFIX, (int)quality); - output.recycle(); - - promise.resolve(file); - } catch (Exception e) { - promise.reject(e); - } } }