From d3947097be2df2be28e1e632207fd21d674325f7 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 4 Aug 2023 22:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJuMethod.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJuMethod.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SrcJuMethod.js b/SrcJuMethod.js index c1adec89..8f467d13 100644 --- a/SrcJuMethod.js +++ b/SrcJuMethod.js @@ -103,16 +103,22 @@ function imageCompress(imgurl,fileid) { const BitmapFactory = android.graphics.BitmapFactory; const FileOutputStream = java.io.FileOutputStream; let options = new BitmapFactory.Options(); - options.inSampleSize = 3; + options.inSampleSize = 2; options.inPurgeable = true; + let options2 = new BitmapFactory.Options(); + options2.inJustDecodeBounds = true; + options2.inPurgeable = true; let bitmap; + let bitmap2; if (topath && typeof path === "object" && path.getClass) { bitmap = BitmapFactory.decodeStream(path, null, options); + bitmap2 = BitmapFactory.decodeStream(path, null, options2); closeMe(path); } else { bitmap = BitmapFactory.decodeFile(path, options); topath = topath || path; } + log(options2); let os = new FileOutputStream(topath); let s = false; try {