qchenqizhi / qcropper Goto Github PK
View Code? Open in Web Editor NEWImage cropping/rotating/straightening library for iOS in Swift
License: MIT License
Image cropping/rotating/straightening library for iOS in Swift
License: MIT License
I'm using the code Above to crop an Image. However the method returns the same image.
i receive the following state in the cropperDidConfirm:
(QCropper.CropperState) state = { viewFrame = (origin = (x = 0, y = 0), size = (width = 360, height = 640)) angle = 5.950118308257335 rotationAngle = 0 straightenAngle = -0.33306699892225122 flipAngle = 0 imageOrientationRawValue = (_value = 0) scrollViewTransform = { a = 0.94504405600579122 b = -0.32694301064271586 c = 0.32694301064271586 d = 0.94504405600579122 tx = 0 ty = 0 } scrollViewCenter = (x = 180, y = 226) scrollViewBounds = (origin = (x = 87.666666666666671, y = 0), size = (width = 407.0358613275223, height = 407.03586132752224)) scrollViewContentOffset = (x = 87.666666666666671, y = 0) scrollViewMinimumZoomScale = 1 scrollViewMaximumZoomScale = 20 scrollViewZoomScale = 2.6081443690409132 cropBoxFrame = (origin = (x = 20, y = 110), size = (width = 320, height = 320)) photoTranslation = (x = 214.75151497001622, y = 278.87409146634593) imageViewTransform = { a = 2.6081443690409132 b = 0 c = 0 d = 2.6081443690409132 tx = 0 ty = 0 } imageViewBoundsSize = (width = 309, height = 412) }
This is great source code to crop the image.
Do you have any idea to crop the final image using CIImage? I'd like to apply CIFilter and crop the image.
Took and a screenshot and tried to crop with QCropper but returns the original image.
How do I get a cropped image based on the coordinates of the original image
I want to get the cropped image location and size
Image resolution change after crop
Looks great! Can I implement this into a SwiftUI app?
Thanks for a good library.
Just wonder how can i keep the cropbox position when rotate 90 degree? I dont want the cropbox size and position changed when I rotate the scrollview.
looking forward your reply soon. Thanks
@qchenqizhi Thank you for this beautiful library. I’m facing a bug that when I just flip the image and click done. and then when I come back with initial state and again change just flip, this time it’s not allowing me to click done.
Is there no any support for flip in state management ?
Hi, thank you for writing such a good framework, implementing a system photo crop editor becomes so easy with it now. But I have some problem while using it. It is hard to get a pure cropRect which size is relative to the original image's size. I don't really need the cropped image rendered, only the size matters, but I have no idea how to retrieve it through the method:
public func cropped(withCropperState cropperState: CropperState) -> UIImage?
Can you give me some hint how to do it?
请问,我在打开剪裁界面时,想设置图片的默认剪裁区域(自动将图片上指定的剪裁区域,缩放至屏幕上合适的尺寸),我应该怎么设置?
@qchenqizhi While taking image using camera and passing image to below function displaying in black color.
let cropper = CropperViewController(originalImage: image)
cropper.delegate = self
picker.dismiss(animated: true) {
self.present(cropper, animated: true, completion: nil)
}
Circular Cropper is not cropped the circular shape. it return only the square cropped image
how to force cropping an image with aspect ratio (9:16)without free scaling?
Thank you for this nice tool.
I tried to re-crop result image and it returned old image without changes
My steps was like this
I think Self.newTransformedImage
cannot be created { maybe because of cgImage property is nil }
And second issue is I tried to crop image with circular overlay (isCircular = true) it returned rectangular result image.
The example provided is working for UiKIt but there no documentation related to SwiftUI
how can get photo from camera and passing to cropViewController?
Great work!!
QCropper is almost similar to Photos.app, works well.
In addition to all these features, I need a rotation gesture to rotate the image using 2 fingers. Could you please let me know whether this iOS framework supports?
Kindly suggest the required changes in the source code.
Thanks in advance.
Siva Prasad K V
Thanks for the best cropping component out there! I have a question: is there any way to avoid flipping an image itself and work out through view transforms during flipping? I'm working on another level cropping tool that uses metal view (MTKView) and I managed to integrate it inside QCropper. But still struggling with flipping.
@qchenqizhi While cropping an image, the quality / size of the image is downgraded. On cropping, the image size decreases approximately more than half of its original.
Any way we can avoid this quality / size downgrade?
Thanks for making this awesome component available.
When I use the AngleRuler control to rotate an image, it does not seem to rotate around the image center axis, as compared to other image editing tools.
It does seem to rotate around center if the image has been zoomed in. It's just in the initial state when image fits inside the overlay that it does not rotate around the center axis.
Is this a bug or is this as designed?
Thanks.
Can you please provide on main page minimal Ios version, i see in project is 12.
how to set up cropbox width and height fixed ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.