Tocropviewcontroller: Croping circular images leads to compression artifacts

Created on 29 May 2018  ·  4Comments  ·  Source: TimOliver/TOCropViewController

  • [x] I have read this issue template and provided all possible information.
  • [x] 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.

bug rfc

Most helpful comment

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 :)

All 4 comments

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.

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?

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!

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Srosman picture Srosman  ·  3Comments

piyushlodaliya picture piyushlodaliya  ·  3Comments

tiviti picture tiviti  ·  8Comments

Snow-Tech picture Snow-Tech  ·  4Comments

agusguerra10 picture agusguerra10  ·  5Comments