Git Product home page Git Product logo

cropview's People

Contributors

idomo avatar jonasbeckers avatar rzmn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cropview's Issues

There is a way to perform "select all" on the cropView?

Hi,
I did found a way to perform "select all" on the cropView, but it's working only with images from the library or ones that taken from the camera, but not from image that created from PDF for example.

This is my solution:

guard let frame = image?.size else { return }
cropView.setCorners(newCorners: [.zero,
    CGPoint(x: frame.width, y: 0),
    CGPoint(x: frame.width, y: frame.height),
    CGPoint(x: 0, y: frame.height)])

From some reason, when I'm running this on an image that created from PDF file, it's returns a very small size, I could say it looks like the thumbnail that you can see in the UIDocumentPickerViewController, but when I'm setting the image as the image of the imageView I can see it all over the screen and very sharp, it doesn't looks like the imageView resized it or something.

So in the bottom line - I wanted to ask if there is some built-in way in the library to perform "select all" or if you have any better idea that will work also with PDF converted to image it will be great.

BTW, the code that I'm using to convert the PDF to UIImage is:

func drawPDFfrom(url: URL) -> UIImage? {
    guard let document = CGPDFDocument(url as CFURL) else { return nil }
    guard let page = document.page(at: 1) else { return nil }

    let pageRect = page.getBoxRect(.mediaBox)
    let renderer = UIGraphicsImageRenderer(size: pageRect.size)
    let img = renderer.image { ctx in
        UIColor.white.set()
        ctx.fill(pageRect)

        ctx.cgContext.translateBy(x: 0.0, y: pageRect.size.height)
        ctx.cgContext.scaleBy(x: 1.0, y: -1.0)

        ctx.cgContext.drawPDFPage(page)
    }

    return img
}

Thanks,
Ido.

Adding a navigation and toolbar element in controller

Hi,
I added a navigation bar and toolbar(on bottom), tried to add via storyboard the CropView, but seems the coordinates and CropView and uiimageView frame are incorrect. Could you please implement a solution to fix this error, please?

Regards,
Rony

make more 4 sided when drag from point in line

lol. First give u a very bigggggg thanks. because it took long tine to found your lib.
I want to ask that question: can i drag from point in a line, that create new corner from this then we can drag it as normally?

possible memory leak that can be fixed easily !

Hi there, nice framework by the way!
I was using another framework that use yours for crop, and I found a memory leak with the picture, and it was easy to fix by declare the "imageView" var as weak var in the class SECropView!
public class SECropView: UIView { ... fileprivate weak var imageView : UIImageView?

hope this help!

Coordinates from Uiimage

Hi,
Could you please implement or add a solution to find coordinates from image and update the points on viewDidAppear method?

Regards,
Rony

Update cocoapods version

Could you tag a new version and update the cocoa pods version with the new fixes? I depend on it for my own library.

Export cropped image

Hi,
Firstly thank you for this amazing solution.

Could you please provide a method to get cropped image?

Regards,
Rony

corner size is very small for large image

Hi, i have just tested with large image size ( about 2000-1000), then i found the large image size, the small circle corner radius, can you give some advices to fix it? Thanks

Moving point area

Hi again,
Could you please specify a moving(dragging) area of points because they can be moved out of margin(screen).

Regards,
Rony

Set crop corners when image is rotated.

Hi, is there a way to reconfigure crop corners when the image is rotated? Something like below:

    @IBAction func rotatePressed(_ sender: Any) {
        let degress = CGFloat.pi / 2
        self.imagePreview.transform = imagePreview.transform.rotated(by: degress)
        let rotatedImage = imagePreview.image!
        cropView.setCorners(newCorners: [
            CGPoint(x: 0, y: 0),
            CGPoint(x: rotatedImage.size.width, y: 0),
            CGPoint(x: rotatedImage.size.width, y: rotatedImage.size.height),
            CGPoint(x: 0, y: rotatedImage.size.height)
        ])
    }

Rotation work here but the crop area is not centered on the image. TIA.

iOS 13 xCode(11) layoutSubviews issue

When layout subviews called, it goes recursive and causes the app to crash.
It seems the problem is in SECropView.swift

public override func layoutSubviews()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.