DZNPhotoPickerController icon indicating copy to clipboard operation
DZNPhotoPickerController copied to clipboard

Is there something wrong with the method - (UIImage *)trimmedImage:(UIImage *)image in DZNPhotoEditorViewController.m?

Open foolish-boy opened this issue 9 years ago • 3 comments

I use this method in my project and found some error.

I have some questions for this methods:

1: what does "loc" mean? why compute it like that?

2: In my project, i found that the top/bottom value may be wrong, which results in black edge in pic.

3: should cropRect.size be ((right.x - left.x + 1)/scale, (bottom.y - top.y + 1)/scale)?

i.stack.imgur.com/sFxlr.jpg i.stack.imgur.com/JOz1Z.jpg

foolish-boy avatar Jun 29 '16 07:06 foolish-boy

I finally found that the width is incorrect, and that just results in black edge.

in my project, i got 690 by method following: width = CGImageGetWidth(CGImageRef ) but i got 690 by other method like this: size_t bpr = CGImageGetBytesPerRow(inImage); //2784 size_t bpp = CGImageGetBitsPerPixel(inImage); // 32 size_t bpc = CGImageGetBitsPerComponent(inImage); //8 size_t bytes_per_pixel = bpp / bpc; // 4 size_t width = bpr / bytes_per_pixel;

I dont know why they are not equal.

foolish-boy avatar Jun 30 '16 06:06 foolish-boy

The attachments do not work.

dzenbot avatar Jul 06 '16 22:07 dzenbot

yes, the attachments do not work, you just need know that there are black edges on bottom or top of pic.

I have fixed the problem by compute width like this: size_t width = bpr / bytes_per_pixel;

I dont know why, is it a bug?

foolish-boy avatar Jul 07 '16 03:07 foolish-boy