From f396ee0445c7a230e196bcaeb589dbec71d58dc0 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 4 Aug 2023 14:46:09 +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, 5 insertions(+), 3 deletions(-) diff --git a/SrcJuMethod.js b/SrcJuMethod.js index f16fd0a7..25588a73 100644 --- a/SrcJuMethod.js +++ b/SrcJuMethod.js @@ -94,8 +94,8 @@ function imageCompress(imgurl,fileid) { function compress(path, inSampleSize, topath) { const Bitmap = android.graphics.Bitmap; const BitmapFactory = android.graphics.BitmapFactory; - let options = new BitmapFactory.Options(); const FileOutputStream = java.io.FileOutputStream; + let options = new BitmapFactory.Options(); options.inSampleSize = inSampleSize || 2; options.inPurgeable = true; let bitmap; @@ -163,7 +163,9 @@ function imageCompress(imgurl,fileid) { log(parseInt(size/1080)); let newpath = "/storage/emulated/0/Android/data/com.example.hikerview/files/Documents/_cache/"+(fileid||"")+"_"+getName(imgurl); log(newpath); - compress(f, 2, newpath); - return "file://" + newpath; + //compress(f, 2, newpath); + compress(f, 8, "/storage/emulated/0/Android/data/com.example.hikerview/files/Documents/_cache/1.jpg"); + //return "file://" + newpath; + return "file:///storage/emulated/0/Android/data/com.example.hikerview/files/Documents/_cache/1.jpg"; } }