我使用Android-Universal-Image-Loader从我的服务器使用.loadImageSync(imageURL)方法下载图像文件。存储后增加的android图像文件大小
然后我需要将该位图保存到用户设备的外部存储。
File file = new File(mContext.getExternalFilesDir(null)+ directoryIntermediatePath,fileName); FileOutputStream fileOutputStream = new FileOutputStream(file);bitmap.compress(Bitmap.CompressFormat.PNG,100,fileOutputStream);
fileOutputStream.flush();
fileOutputStream.close();
我的问题是我的服务器上保存大小约为200KB的.png文件,这将在安卓设备存储过程中变成大约700KB。
而不是质量压缩到100将其更改为70或80,这将减少您的大小。 – SilentKiller
但是这种方式我不能确定用户设备上的文件大小,我想确保质量和大小与我的服务器上的大小相同。 –
@SilentKiller自PNG使用无损压缩我怀疑降低质量有什么影响。 – Henry