@@ -10,10 +10,10 @@ import android.graphics.Matrix
1010import android.net.Uri
1111import android.util.Base64
1212import androidx.core.graphics.scale
13- import io.ionic.libs.ioncameralib.model.IONError
13+ import io.ionic.libs.ioncameralib.model.IONCAMRError
1414import java.io.*
1515
16- class OSCAMRImageHelper : OSCAMRImageHelperInterface {
16+ class IONCAMRImageHelper : IONCAMRImageHelperInterface {
1717
1818 companion object {
1919 private const val JPEG = 0
@@ -50,9 +50,9 @@ class OSCAMRImageHelper: OSCAMRImageHelperInterface {
5050 return BitmapFactory .decodeByteArray(byteArray, 0 , byteArray.size)
5151 }
5252
53- override fun compressImage (activity : Activity ? , uri : Uri ? , bitmap : Bitmap ? , compressFormat : CompressFormat , mQuality : Int , onError : (IONError ) -> Unit ){
53+ override fun compressImage (activity : Activity ? , uri : Uri ? , bitmap : Bitmap ? , compressFormat : CompressFormat , mQuality : Int , onError : (IONCAMRError ) -> Unit ){
5454 if (bitmap == null || uri == null || activity == null ){
55- onError(IONError .PROCESS_IMAGE_ERROR )
55+ onError(IONCAMRError .PROCESS_IMAGE_ERROR )
5656 return
5757 }
5858 val os: OutputStream ? =
@@ -68,7 +68,7 @@ class OSCAMRImageHelper: OSCAMRImageHelperInterface {
6868 *
6969 * @param bitmap
7070 */
71- override fun processPicture (bitmap : Bitmap ? , encodingType : Int , mQuality : Int , onSuccess : (String ) -> Unit , onError : (IONError ) -> Unit ) {
71+ override fun processPicture (bitmap : Bitmap ? , encodingType : Int , mQuality : Int , onSuccess : (String ) -> Unit , onError : (IONCAMRError ) -> Unit ) {
7272 val jpegData = ByteArrayOutputStream ()
7373 val compressFormat: CompressFormat =
7474 if (encodingType == JPEG ) CompressFormat .JPEG else CompressFormat .PNG
@@ -80,7 +80,7 @@ class OSCAMRImageHelper: OSCAMRImageHelperInterface {
8080 onSuccess(jsOut)
8181 }
8282 } catch (e: Exception ) {
83- onError(IONError .PROCESS_IMAGE_ERROR )
83+ onError(IONCAMRError .PROCESS_IMAGE_ERROR )
8484 }
8585 }
8686
@@ -92,7 +92,7 @@ class OSCAMRImageHelper: OSCAMRImageHelperInterface {
9292 return BitmapFactory .decodeFile(resultImagePath)
9393 }
9494
95- override fun bitmapToBase64 (result : Bitmap ? , resolution : Int , quality : Int , onSuccess : (String ) -> Unit , onError : (IONError ) -> Unit ) {
95+ override fun bitmapToBase64 (result : Bitmap ? , resolution : Int , quality : Int , onSuccess : (String ) -> Unit , onError : (IONCAMRError ) -> Unit ) {
9696 val byteArrayOutputStream = ByteArrayOutputStream ()
9797 result?.let {
9898 val resizedImage = this .downsizeBitmapIfNeeded(it, resolution)
@@ -104,7 +104,7 @@ class OSCAMRImageHelper: OSCAMRImageHelperInterface {
104104 }
105105 }
106106
107- onError(IONError .EDIT_IMAGE_ERROR )
107+ onError(IONCAMRError .EDIT_IMAGE_ERROR )
108108 return
109109 }
110110
0 commit comments