|
|
@ -95,6 +95,7 @@ function imageCompress(imgurl,fileid) { |
|
|
|
if (!path) { |
|
|
|
if (!path) { |
|
|
|
return imgurl; |
|
|
|
return imgurl; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let obj = path; |
|
|
|
let tmpfile = "hiker://files/_cache/1.txt"; |
|
|
|
let tmpfile = "hiker://files/_cache/1.txt"; |
|
|
|
if (!fileExist(tmpfile)) { |
|
|
|
if (!fileExist(tmpfile)) { |
|
|
|
writeFile(tmpfile, ''); |
|
|
|
writeFile(tmpfile, ''); |
|
|
@ -125,12 +126,12 @@ function imageCompress(imgurl,fileid) { |
|
|
|
options2.inSampleSize = parseInt(size/720) || 2; |
|
|
|
options2.inSampleSize = parseInt(size/720) || 2; |
|
|
|
options2.inPurgeable = true; |
|
|
|
options2.inPurgeable = true; |
|
|
|
let bitmap2; |
|
|
|
let bitmap2; |
|
|
|
if (topath && typeof path === "object" && path.getClass) { |
|
|
|
if (topath && typeof obj === "object" && obj.getClass) { |
|
|
|
bitmap2 = BitmapFactory.decodeStream(path, null, options2); |
|
|
|
bitmap2 = BitmapFactory.decodeStream(obj, null, options2); |
|
|
|
closeMe(path); |
|
|
|
closeMe(obj); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
bitmap2 = BitmapFactory.decodeFile(path, options2); |
|
|
|
bitmap2 = BitmapFactory.decodeFile(obj, options2); |
|
|
|
topath = topath || path; |
|
|
|
topath = topath || obj; |
|
|
|
} |
|
|
|
} |
|
|
|
let os = new FileOutputStream(topath); |
|
|
|
let os = new FileOutputStream(topath); |
|
|
|
try { |
|
|
|
try { |
|
|
|