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

Image is compressed even when quality is set to 100 #239

Open
anth0 opened this issue Dec 21, 2020 · 0 comments
Open

Image is compressed even when quality is set to 100 #239

anth0 opened this issue Dec 21, 2020 · 0 comments

Comments

@anth0
Copy link

anth0 commented Dec 21, 2020

I'm expecting to get the full original picture when importing with quality set to 100. However I get a highly compressed image in return (~500KB compressed vs ~7MB original).

This is because of the compression done in GMGridViewController when writing the image to file:
// setting compression to a low value (high compression) impact performance, but not actual img quality if ( ![ UIImageJPEGRepresentation(imageToDisplay, 0.2f) writeToFile:filePath atomically:YES ] ) { return; }

To me the comment is not true as any compression affects image quality. It might not be much but artefacts can be visible upon compression which is not what I expect.

The correct code is commented out a few lines above but I don't know why. Could someone explain? Otherwise I can suggest a PR to use the quality option given as input as the compression rate.

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

1 participant