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

Croping circular images leads to compression artifacts #279

Closed
2 tasks done
ntnmrndn opened this issue May 29, 2018 · 4 comments
Closed
2 tasks done

Croping circular images leads to compression artifacts #279

ntnmrndn opened this issue May 29, 2018 · 4 comments

Comments

@ntnmrndn
Copy link

  • I have read this issue template and provided all possible information.
  • I'm using CocoaPods and have run pod update before filing this issue.

When using TOCropViewController to make round pictures, the off camera is filled with white.
This is an issue because when compressing to JPEG, the neighboring pixels on the edges of the circle are averaged and present white artifacts.

See:

img_0239

I think that for most users, actually removing the data from the image is of no benefit since the image will be cropped at display time. We could simply perform a square crop, assuming that people want a circle preview style and not actually a circle crop.

An other solution could be to leave a small border outside of the crop zone.

@ntnmrndn
Copy link
Author

I don't mind submitting a PR; but I'd like to get some feedback before I start working on it. I am in favor of a square crop.

@TimOliver
Copy link
Owner

Sorry for the delay!

Hmm, that's somewhat curious with the compression artefacts. I'll have to look at that.

In the meantime, I'm pretty sure that if you just implement the didCropToImage delegate and not the didCropToCircularImage one, it'll supply you with a square version of the image you cropped.

Can you confirm to see if that fixes your issue?

@TimOliver
Copy link
Owner

Closing this off due to inactivity. I double-checked to confirm that you can indeed receive a square image from the circular style if you implement the right delegate.

Let me know if you find any more issues like this. Thanks!

@ntnmrndn
Copy link
Author

Hello,

I'm sorry for the inactivity; I had temporary removed this part from my app so I couldn't confirm anymore.

You are right !

Thank you for your time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants