From e69f251431cfa31966c0f8b8f93c10e4ac0e0198 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 4 Aug 2023 16:53:31 +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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SrcJuMethod.js b/SrcJuMethod.js index 009f9e3c..d7bbf983 100644 --- a/SrcJuMethod.js +++ b/SrcJuMethod.js @@ -95,6 +95,7 @@ function imageCompress(imgurl,fileid) { if (!path) { return imgurl; } + let obj = path; let tmpfile = "hiker://files/_cache/1.txt"; if (!fileExist(tmpfile)) { writeFile(tmpfile, ''); @@ -125,12 +126,12 @@ function imageCompress(imgurl,fileid) { options2.inSampleSize = parseInt(size/720) || 2; options2.inPurgeable = true; let bitmap2; - if (topath && typeof path === "object" && path.getClass) { - bitmap2 = BitmapFactory.decodeStream(path, null, options2); - closeMe(path); + if (topath && typeof obj === "object" && obj.getClass) { + bitmap2 = BitmapFactory.decodeStream(obj, null, options2); + closeMe(obj); } else { - bitmap2 = BitmapFactory.decodeFile(path, options2); - topath = topath || path; + bitmap2 = BitmapFactory.decodeFile(obj, options2); + topath = topath || obj; } let os = new FileOutputStream(topath); try {