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