Comments (4)
@slashburn Thank you for your feedback and valuable suggestion, we'll look into this in future release.
Meanwhile if you managed to solve this for yourself, feel free to submit a pull request.
from imagepicker.
I did a workaround with a UIImage extension, but I agree it would be better to include it in the project directly:
class func cropCameraImage(image: UIImage, viewHeight: CGFloat) -> UIImage {
//The height of the bottom view in the ImagePickerCamera
//It is specified as 101 points.
let imagePickerBottomContainerHeight: CGFloat = 101.0
let contextImage = UIImage(CGImage: image.CGImage!)
let percentage = imagePickerBottomContainerHeight / viewHeight
let newHeight = image.size.height - percentage*image.size.height
let cropRect = CGRect(x: 0, y: 0, width: image.size.width, height: newHeight)
let imageRef: CGImageRef = CGImageCreateWithImageInRect(contextImage.CGImage, cropRect)!
let croppedImage = UIImage(CGImage: imageRef, scale: image.scale, orientation: image.imageOrientation)
return croppedImage
}
The first parameter is the UIImage that is returned from the camera, the second is the height of the entire screen. So you would call it like in your view controller (that conforms to the ImagePickerDelegate) like so:
let croppedImage = UIImage.cropCameraImage(image, self.view.frame.height)
from imagepicker.
did anyone figure out how to achieve this one?
from imagepicker.
@slashburn @choutiy Hi, this is a valid concern. While some people find it confused not to crop the lower part, other people actually want to take image full screen. This was by design so we don't plan to change it, in the mean time @choutiy you can take a look at what @slashburn suggested
from imagepicker.
Related Issues (20)
- [BUG]the backgroud music is stoped HOT 1
- Unselecting image returns nil array HOT 2
- AVCaptureDevice device Type HOT 3
- on iOS 14 capture put images to camera roll but shutter counter and picture preview are not updated HOT 1
- Cannot unselecting image when setting "imageLimit" to 1. HOT 4
- If shot button pressed too frequently image might loss on old iPhones HOT 1
- AVCaptureStillImageOutput' was deprecated in iOS 10.0: Use AVCapturePhotoOutput instead HOT 1
- 'flashMode' and 'isflashMode' was deprecated in iOS 10.0: Use AVCapturePhotoSettings.flashMode instead. HOT 1
- Gallery In Full Screen Mode HOT 2
- SPM support HOT 8
- When I select photos, I have no way of knowing which photos I chose.
- Camera does not rotate HOT 1
- The ultra wide angle does not work with the camera HOT 1
- Doesn't compile in XCode 13 HOT 9
- Is there a camera only mode? HOT 1
- using callback instead of delegate
- Is this project officialy "stopped" ?
- doneButtonDidPress not working
- Ultra Wide Angle Functionality Support HOT 1
- Multiple image Select but Not getting While using delegate also
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagepicker.