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

使用相机并截图时,返回的是完整的图片而不是截出来的图片 #8

Closed
AIFun opened this issue Mar 17, 2016 · 6 comments

Comments

@AIFun
Copy link

AIFun commented Mar 17, 2016

看了图片目录,两个图片都存在,但是返回的图片如题所说是完整的。
感觉问题出现在/imageselector/src/main/java/com/yancy/imageselector/ImageSelectorActivity.java的onCameraShot函数

    public void onCameraShot(File imageFile) {
        if (imageFile != null) {
            Intent data = new Intent();
            pathList.add(imageFile.getAbsolutePath());
            data.putStringArrayListExtra(EXTRA_RESULT, pathList);
            setResult(RESULT_OK, data);
            exit();
        }
        if (imageFile != null) {
            if (imageConfig.isCrop()) {
                crop(imageFile.getAbsolutePath(), imageConfig.getAspectX(), imageConfig.getAspectY(), imageConfig.getOutputX(), imageConfig.getOutputY());
            } else {
                Intent data = new Intent();
                pathList.add(imageFile.getAbsolutePath());
                data.putStringArrayListExtra(EXTRA_RESULT, pathList);
                setResult(RESULT_OK, data);
                exit();
            }
        }

两个if的判断条件一样,那样应该后一个if是无效的。
但是同时我使用相机的时候的确是进入了截图的界面,感觉是进入了第二个if并执行截图操作了的。
我正在想办法调试。在这之前也发给你看看吧。

@YancyYe
Copy link
Owner

YancyYe commented Mar 17, 2016

把上面的 if 删掉应该就可以了 可能更新的时候疏忽了 我这边调试下。

@AIFun
Copy link
Author

AIFun commented Mar 17, 2016

的确是去掉第一个if就可以了。

@liudao01
Copy link

@AIFun 问下你怎么打开成功的 我下载打不开

@AIFun
Copy link
Author

AIFun commented Jun 22, 2016

@liudao01 你说的是原代码吗?直接用git下载下来加到自己的项目里的

@liudao01
Copy link

@AIFun 关键下载 gradle总是挂掉 哎 我也遇到和你一样的问题了 最后我是获取最新修改的文件解决的

@YancyYe
Copy link
Owner

YancyYe commented Feb 7, 2017

https://github.com/YancyYe/GalleryPick 项目已重构

@YancyYe YancyYe closed this as completed Feb 7, 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