siwangqishiq / ImageEditor-Android

AndroidImageEdit 安卓设备上图形编辑开源控件,支持磨皮美白 自定义贴图 图片滤镜 图片旋转 图片剪裁 文字贴图 撤销 回退 等操作
2.19k stars 567 forks source link

Reduced resolution after edit #46

Open viseator opened 6 years ago

viseator commented 6 years ago

Hello, I started a camera app project several days ago, in which I found your lib is really helpful.

But I found that the output image's resolution is reduced to the resolution of view (or the bitmap corresponding to it), which is out of my expectation. Is it a feature or bug?

I found the code may cause the problem:

return BitmapUtils.getSampledBitmap(params[0], imageWidth, imageHeight);

in which imageWidth and imageHeight was set by those code:

DisplayMetrics metrics = getResources().
imageWidth = metrics.widthPixels / 2;
imageHeight = metrics.heightPixels / 2;

After replace the code above with this:

return BitmapFactory.decodeFile(params[0]);

Things seems to work perfectly.

siwangqishiq commented 6 years ago

Yes it is a feature,You can't load a origin image , if you select a image with huge size will occur a Out Of Memory ,So This library set image's width and height ( reset sample value)