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

[FIX] Poor image quality after cropping #825

Closed
wants to merge 1 commit into from

Conversation

diegolmello
Copy link

@ivpusic We talked about this at #754.

On iOS, we were cropping the image twice.
On Android, image size were default 200x200.

Thanks!

@keshamtravels
Copy link

Please merge this pull request asap and what i would need to do if i want to get latest changes in my app for this repo

@evaleirasclapps
Copy link

Merge please! I need this

@ivpusic
Copy link
Owner

ivpusic commented Sep 19, 2018

@ivpusic ivpusic closed this Sep 19, 2018
@diegolmello
Copy link
Author

@ivpusic Why haven't you accepted my PR? As this is a community, it would be nice to get my name as contributor (not just on the release).

@ivpusic
Copy link
Owner

ivpusic commented Sep 19, 2018

I appologize for that @diegolmello, I did some small changes based on your fork in a seaparate branch, and pushed everything together to master

@evaleirasclapps
Copy link

When is going to be released to NPM??

@ivpusic
Copy link
Owner

ivpusic commented Sep 19, 2018

it is already released in version 0.21.2

@evaleirasclapps
Copy link

This did not work for me, I added compressImageQuality: 1 and it's still compress the image TOO MUCH

@haseebnaseem
Copy link

The fix does does not work.

@haseebnaseem
Copy link

Did anyone solve this ? The fix works on iOS but not android

@SkariDamm
Copy link

I was facing the same problem on Android when using the device dimensions as crop dimensions options for ImagePicker.openCamera.

I was successful in retaining the full image quality by doing:

const image = await ImagePicker.openCamera({});
const croppedImage = await ImagePicker.openCropper({
    path: image.path,
    width: image.width,
    height: (image.width * 9) / 16
});

@Lowisoft
Copy link

Lowisoft commented Oct 4, 2018

Hi, the changes that were made in this pull request (for iOS) caused another issue where the image doesn't get resized to the given height and width prop as stated here: #843.

Undoing the changes of this pull request solves the issue. So, I think the code must be reversed or adapted in the next release.

@diegolmello
Copy link
Author

This PR works in my case, because I don't pass width and height props.
It was resizing, cropping, compressing and resizing again.
It may cause issues if you pass width and height, as pointed out.

@Lowisoft
Copy link

Lowisoft commented Oct 4, 2018

Yes, but it's a pity that we can't use fixed width and height props after this PR (which is an essential part of cropping) and that there might be other people who will run into this issue too.

@diegolmello
Copy link
Author

@Lowisoft Yeah 😢
If you find out a way to get compression and crop working for both cases (with and without width/height), please open a PR.

@Lowisoft
Copy link

Lowisoft commented Oct 4, 2018

@diegolmello Unfortunately, I am not very familiar with Swift.
Does the changed code (for iOS) only fix the double cropping? In fact, without these changes everything works as expected and I didn't notice that the double cropping or quality caused any problems on a real iOS device.

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

Successfully merging this pull request may close these issues.

7 participants