Skip to content
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

好像是导致不清晰的原因 #95

Closed
u787i opened this issue Nov 23, 2016 · 5 comments
Closed

好像是导致不清晰的原因 #95

u787i opened this issue Nov 23, 2016 · 5 comments
Milestone

Comments

@u787i
Copy link

u787i commented Nov 23, 2016

213, 214 行 width 和 height 转变成了 最短边 和 最长边

        width = thumbW > thumbH ? thumbH : thumbW;
        height = thumbW > thumbH ? thumbW : thumbH;

可是后面有用它来当做宽高来计算 (取名字 多么重要)

   thumbW = width / 2;
   thumbH = height / 2;
   thumbW = width / 4;
    thumbH = height / 4;

是不是想写 ?

thumbW/=2;
@u787i
Copy link
Author

u787i commented Nov 23, 2016

哦 还有和问题 220行

                if (file.length() / 1024 < 150) return file;

最好不要直接返回 file 哦 可以直接拷贝一到目标文件 否则用完压缩图片要删除的逻辑 就把原图删了 ..

一点建议 祝好 ^ , ^

@shaohui10086
Copy link
Contributor

关于返回原图的问题,我想探讨一下:

  1. 可不可以返回原图?
    我个人觉得是可以的,因为官方就有API是这么做的,比如Bitmap.createScaledBitmap()这个接口,就是有可能返回原来的bitmap

2.压缩完要删除原图的需求
我还没见过这样的需求...真的会有这样的需求吗,如果有,为了这样一个需求去改造工具呢,还是改变工具的使用方式,这个我应该会选择后者。

只是简单说下自己的想法,说的不对的地方,见谅:)

@u787i
Copy link
Author

u787i commented Feb 20, 2017

如果图片需要压缩 可能是要做上传的 这个时候就需要 清理压缩后的数据了 不是删除原图 而是压缩后的小图

@u787i
Copy link
Author

u787i commented Feb 20, 2017

Bitmap.createScaledBitmap() 那可是在内存里的对象 而不是文件

@u787i
Copy link
Author

u787i commented Feb 20, 2017

嘿嘿 其实 这问题 不会有那么大分歧 使用环境不同嘛

@Curzibn Curzibn added this to the 1.1.0 milestone Jun 10, 2017
@Curzibn Curzibn closed this as completed Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants