修复错误

mem
Matthew 6 months ago
parent b55c454876
commit c7c564ddec

@ -4,12 +4,12 @@ plugins {
}
android {
compileSdk 32
compileSdk 33
defaultConfig {
applicationId "com.xypower.camera2raw"
minSdk 25
targetSdk 32
applicationId "com.xypower.mppreview"
minSdk 28
targetSdk 30
versionCode 1
versionName "1.0"

@ -59,8 +59,6 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import org.opencv.android.OpenCVLoader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

@ -2,8 +2,10 @@ package com.xypower.mppreview;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.ImageDecoder;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@ -14,6 +16,15 @@ import java.util.List;
public class RawToJpgConverter {
public static void closeFriendly(Closeable closeable) {
if (null != closeable) {
try {
closeable.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static List<String> listFiles(File directory) {
ArrayList list = new ArrayList();
@ -43,7 +54,7 @@ public class RawToJpgConverter {
} catch (Exception ex) {
ex.printStackTrace();
} finally {
closeOutput(output);
closeFriendly(output);
if (bmp != null) {
bmp.recycle();
}

Loading…
Cancel
Save