New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于裁剪比例,裁剪宽高和压缩之间的关系 #29
Comments
还有,我看到昨天更新了一下修复了一个bug,依赖还是1.2.5吗?不用更新的? |
我这几天在办离职手续,后面我会调试一下,应该是裁剪后压缩时我取的不是裁剪图进行压缩的,昨天更新的,暂时没有更新的必要,我后续会把反馈的问题整理改好在发布新版本。 |
好的,我这边项目里已经集成了,更新了再改吧 |
我刚试了下,裁剪后压缩 根据设置的裁剪值不同,有时候压缩4倍,有时候压缩两倍,我这边暂时只去裁剪后的路径就可以了吧?因为要上线 |
对,如果你压缩过,在取压缩的地址 |
还久没来了,这个问题修复了吧,手动斜眼 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好,我这边这三个参数设置为如下:(裁剪比例1:1,裁剪宽高1200,1200,压缩宽高1100,1100)
config.setCopyMode(copyMode);//1:1 config.setCompress(isCompress);//true config.setEnablePixelCompress(false); config.setEnableQualityCompress(true); config.setMaxSelectNum(maxSelectNum); config.setSelectMode(selectMode); config.setShowCamera(isShow); config.setEnablePreview(enablePreview); config.setEnableCrop(enableCrop); config.setPreviewVideo(isPreviewVideo); config.setRecordVideoDefinition(FunctionConfig.HIGH);// 视频清晰度 config.setRecordVideoSecond(60);// 视频秒数 config.setCropW(cropW);//1200 config.setCropH(cropH);//1200 config.setCheckNumMode(isCheckNumMode); config.setCompressQuality(100); config.setImageSpanCount(4); config.setSelectMedia(selectMedia); config.setCompressFlag(compressFlag); config.setCompressW(compressW);//1100 config.setCompressH(compressH);//1100
回调的代码:
if (selectMedia.get(0).getPath() != null) {
Bitmap bt1 = BitmapFactory.decodeFile(selectMedia.get(0).getPath());
Log.i("bt1", "高"+bt1.getHeight() + "宽" + bt1.getWidth());
bt1.recycle();
Log.i("原图", new File(selectMedia.get(0).getPath()).length() / 1024 + "k");
}
if (selectMedia.get(0).getCutPath() != null) {
Bitmap bt2 = BitmapFactory.decodeFile(selectMedia.get(0).getCutPath());
Log.i("bt2", "高"+bt2.getHeight() + "宽" + bt2.getWidth());
bt2.recycle();
Log.i("裁剪", new File(selectMedia.get(0).getCutPath()).length() / 1024 + "k");
}
if (selectMedia.get(0).getCompressPath() != null) {
Bitmap bt3 = BitmapFactory.decodeFile(selectMedia.get(0).getCompressPath());
Log.i("bt3", "高"+bt3.getHeight() + "宽" + bt3.getWidth());
bt3.recycle();
Log.i("压缩", new File(selectMedia.get(0).getCompressPath()).length() / 1024 + "k");
}
但是打印的结果为下面的:
02-14 10:47:12.958 9673-22355/com.luck.pictureselector I/BitmapCropTask: Should crop: true
02-14 10:47:15.438 9673-9673/com.luck.pictureselector I/bt1: 高4160宽3120
02-14 10:47:15.438 9673-9673/com.luck.pictureselector I/原图: 3310k
02-14 10:47:15.578 9673-9673/com.luck.pictureselector I/bt2: 高1200宽1200
02-14 10:47:15.578 9673-9673/com.luck.pictureselector I/裁剪: 938k
02-14 10:47:15.588 9673-9673/com.luck.pictureselector I/bt3: 高300宽300
02-14 10:47:15.588 9673-9673/com.luck.pictureselector I/压缩: 71k
02-14 10:47:15.588 9673-9673/com.luck.pictureselector I/callBack_result: 1
02-14 10:47:15.608 9673-9673/com.luck.pictureselector I/Choreographer: Skipped 57 frames! The application may be doing too much work on its main thread.
02-14 10:47:15.608 9673-9673/com.luck.pictureselector I/compress image result: 71k
裁剪后的宽高和我设置的是一样的1200,但是压缩后怎么直接变为300,300了呢?并不是1100,1100
The text was updated successfully, but these errors were encountered: