yummypets / ypimagepicker Goto Github PK
View Code? Open in Web Editor NEW๐ธ Instagram-like image picker & filters for iOS
License: MIT License
๐ธ Instagram-like image picker & filters for iOS
License: MIT License
@pngo-hypewell
The crop videos into squares is also a perfect feature at this time. Hope you guys can implement it soon. Someone made it in PryntTrimmerView
https://github.com/prynt/PryntTrimmerView
When I open the picker for the first time it asks me for permissions. If I deny the first request (Photo Library), then allow the second (Camera usage) and then deny the third one (Microphone) then, at first, it shows a black square instead of a camera preview (although the camera permission was granted). If I switch to the photo library picker (which is unaccessible due to denied permission and it's ok) and then switch again to the camera preview it shows normally.
And then, if I took a photo, it'll crash with this message:
This application is not allowed to access Photo data.
It happens even when the shouldSaveNewPicturesToAlbum
is set to false
The full crash stack trace:
[Generic] *** This application is not allowed to access Photo data. (
0 PhotoLibraryServices 0x000000018fad5f38 + 1096
1 Photos 0x000000019091b63c + 84
2 Photos 0x00000001908ec664 + 128
3 Photos 0x0000000190903834 + 196
4 YPImagePicker 0x0000000106247c28 _T013YPImagePicker9FSAlbumVCCfETo + 176
5 libobjc.A.dylib 0x0000000181822ef4 + 148
6 libobjc.A.dylib 0x0000000181830638 objc_destructInstance + 88
7 libobjc.A.dylib 0x0000000181830690 object_dispose + 16
8 UIKit 0x000000018bad78f4 + 156
9 UIKit 0x000000018b88de7c + 1776
10 YPImagePicker 0x0000000106247b30 _T013YPImagePicker9FSAlbumVCCfD + 220
11 YPImagePicker 0x0000000106247b68 _T013YPImagePicker9FSAlbumVCCfDTo + 40
12 libswiftCore.dylib 0x00000001066a9798 _ZN5swift12metadataimpl14ValueWitnessesINS0_17ObjCRetainableBoxEE12destroyArrayEPNS_11OpaqueValueEmPKNS_14TargetMetadataINS_9InProcessEEE + 36
13 libswiftCore.dylib 0x000000010643aa7c _T0s23_ContiguousArrayStorageCfD + 60
14 libswiftCore.dylib 0x00000001066a7280 _swift_release_dealloc + 28
15 YPImagePicker 0x000000010626a648 _T013YPImagePicker13FSBottomPagerCfETo + 80
16 libobjc.A.dylib 0x0000000181822ef4 + 148
17 libobjc.A.dylib 0x0000000181830638 objc_destructInstance + 88
18 libobjc.A.dylib 0x0000000181830690 object_dispose + 16
19 UIKit 0x000000018bad78f4 + 156
20 UIKit 0x000000018b88de7c + 1776
21 YPImagePicker 0x00000001062a1c50 _T013YPImagePickerAACfETo + 120
22 libobjc.A.dylib 0x0000000181822ef4 + 148
23 libobjc.A.dylib 0x0000000181830638 objc_destructInstance + 88
24 libobjc.A.dylib 0x0000000181830690 object_dispose + 16
25 UIKit 0x000000018bad78f4 + 156
26 UIKit 0x000000018b88de7c + 1776
27 UIKit 0x000000018b8987e4 + 488
28 UIKit 0x000000018ba6b730 + 372
29 libobjc.A.dylib 0x0000000181822ef4 + 148
30 libobjc.A.dylib 0x0000000181830638 objc_destructInstance + 88
31 libobjc.A.dylib 0x0000000181830690 object_dispose + 16
32 UIKit 0x000000018ba66f1c + 64
33 UIKit 0x000000018c2abcc4 + 64
34 UIKit 0x000000018ba66ba8 + 24
35 libsystem_blocks.dylib 0x0000000181d35a60 _Block_release + 160
36 UIKit 0x000000018c39dbec + 116
37 libobjc.A.dylib 0x0000000181822ef4 + 148
38 libobjc.A.dylib 0x0000000181830638 objc_destructInstance + 88
39 libobjc.A.dylib 0x0000000181830690 object_dispose + 16
40 UIKit 0x000000018b833b90 + 64
41 UIKit 0x000000018b833b40 + 88
42 libobjc.A.dylib 0x0000000181822ef4 + 148
43 libobjc.A.dylib 0x0000000181830638 objc_destructInstance + 88
44 libobjc.A.dylib 0x0000000181830690 object_dispose + 16
45 UIKit 0x000000018b832334 + 1340
46 UIKit 0x000000018b831de4 + 120
47 UIKit 0x000000018b75770c + 312
48 UIKit 0x000000018b757418 + 296
49 UIKit 0x000000018b7574b8 + 456
50 QuartzCore 0x00000001862fbd6c + 284
51 libdispatch.dylib 0x0000000106f7145c _dispatch_client_callout + 16
52 libdispatch.dylib 0x0000000106f76050 _dispatch_main_queue_callback_4CF + 1192
53 CoreFoundation 0x00000001822b7f20 + 12
54 CoreFoundation 0x00000001822b5afc + 2012
55 CoreFoundation 0x00000001821d62d8 CFRunLoopRunSpecific + 436
56 GraphicsServices 0x0000000184067f84 GSEventRunModal + 100
57 UIKit 0x000000018b783880 UIApplicationMain + 208
58 myExample 0x0000000104eedd08 main + 76
59 libdyld.dylib 0x0000000181cfa56c + 4
)
I'm wondering if I can somehow took non-squared photos using the "Photo" tab. Is that possible?
Crashes happen when people denied photo/video access and tap Photo taking related buttons (flash/ shot, focus etc)
I have set 'Privacy - Photo Library Usage Description' and 'This lets you take photos and record video.'And let it run on iPhone 6plus, when present the picker, it will crash.On the simulatorm, it crashs at ' videoInput = try? AVCaptureDeviceInput(device: aDevice)'
public func constraint(item view1: AnyObject,
attribute attr1: NSLayoutAttribute,
relatedBy: NSLayoutRelation = .equal,
toItem view2: AnyObject? = nil,
attribute attr2: NSLayoutAttribute? = nil, // Not an attribute??
multiplier: CGFloat = 1,
constant: CGFloat = 0) -> NSLayoutConstraint {
let c = NSLayoutConstraint(item: view1, attribute: attr1,
relatedBy: relatedBy,
toItem: view2, attribute: ((attr2 == nil) ? attr1 : attr2! ),
multiplier: multiplier, constant: constant)
c.priority = UILayoutPriority(rawValue: UILayoutPriority.defaultHigh.rawValue + 1)
return c
}
Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (209) must be equal to the number of items contained in that section before the update (209), plus or minus the number of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x181343164 __exceptionPreprocess
1 libobjc.A.dylib 0x18058c528 objc_exception_throw
2 CoreFoundation 0x181343038 +[NSException raise:format:]
3 Foundation 0x181cdd7f4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UIKit 0x18b399760 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:]
5 UIKit 0x18b39d250 -[UICollectionView _endUpdatesWithInvalidationContext:tentativelyForReordering:animator:]
6 UIKit 0x18b39d534 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:]
7 UIKit 0x18b39d390 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:]
8 UIKit 0x18b39d314 -[UICollectionView _performBatchUpdates:completion:invalidationContext:]
9 UIKit 0x18aab921c -[UICollectionView performBatchUpdates:completion:]
10 YPImagePicker 0x100d044f8 (Missing)
11 YPImagePicker 0x100d0419c (Missing)
12 YPImagePicker 0x100cf28c4 (Missing)
13 libdispatch.dylib 0x180cc2a54 _dispatch_call_block_and_release
14 libdispatch.dylib 0x180cc2a14 _dispatch_client_callout
15 libdispatch.dylib 0x180ccf698 _dispatch_main_queue_callback_4CF$VARIANT$mp
16 CoreFoundation 0x1812eb344 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
17 CoreFoundation 0x1812e8f20 __CFRunLoopRun
18 CoreFoundation 0x181208c58 CFRunLoopRunSpecific
19 GraphicsServices 0x1830b4f84 GSEventRunModal
20 UIKit 0x18a9615c4 UIApplicationMain
When the camera starts first and then you change to the library, there is a white bar ontop of the first row of library images (roughly 40pt). It goes away if you scroll down.
when pick photo from gallery quality reduce and photo resolution down
i'm getting [!] Unable to find a specification for YPImagePicker
and when I force source using :
pod 'YPImagePicker',:git => 'https://github.com/Yummypets/YPImagePicker'
it says no such module for Stevia and when I add stevia to project I get lots of syntax error
Respective Team,
there is a error "Type 'UILayoutPriority' (aka 'Float') has no member 'defaultHigh"
in Stevia+Constraints.swift class. Please guide us to solve that.
I was wondering if there was currently a way to choose a specific thumbnail for a video?
Thanks.
When we are creating object of YPImagePicker and present it as view controller I need to open Library option first insted of Photo. How to do that? Thanks.
Hello sir, Pods is still old version
When run the git project it shows,
Module compiled with Swift 4.0.3 cannot be imported in Swift 4.0: /Users/Aneena/Downloads/YPImagePicker-master 2/Carthage/Build/iOS/Stevia.framework/Modules/Stevia.swiftmodule/x86_64.swiftmodule
Please give access to those functions for custom dismissal etc.
Currently its private
First of all, Thank You!! for your great work.
I was wondering if you have in your future improvements the multiple image selection?? Or even if there is a way that I can help with it, in my spare time ๐
Thanks!
cc @s4cha
User has to swipe to library view and back to camera view to start capture photo. This issue happens on first time YPImagePicker is shown after the app starts running. Sometimes the app freezes on photo capture view for 5 seconds.
Issue also exists in the example app.
let imageOutput = AVCaptureStillImageOutput()
let data = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(buffer!)
'AVCaptureStillImageOutput' was deprecated in iOS 10.0: Use AVCapturePhotoOutput instead
v.flashButton.setImage(flashImage(forAVCaptureFlashMode: device.flashMode), for: .normal)
'flashMode' was deprecated in iOS 10.0: Use AVCapturePhotoSettings.flashMode instead.
iOS 11.2.x
iPhone X
Hey guys, I found this issue. If you are in filter view after you took a photo and go back, the camera is not activate so it seems that is frozen. Also, if you tap on shot button it will crash.
Hey guys, nice work with this project!
I was wondering if is there a possibility to customised the UI Objects like it was possible in Fusuma?
iOS 11.2.x
iPhone X
Hey guys, I found this issue. If you are in library section in YPImagePicker and go to native photo library of the device and delete an image, the app crash when you come back to it.
your code is not updated for version 1.2.1 and also there is no Edit option like Instagram . Please update it for swift3 and multiple image selection is not working.
I've updated the code to the 2.6.1 build but have noticed that the camera will take 7-10 seconds to open and sometimes will not open at all. I'm testing on an iPhone 6s, iOS 11.2.5.
Hi,
I cannot see any option for chaning the button titles. They are called:
"Ypimagepickerlibrary", "Ypimagepickerphoto", ... and in the navigation bar "YPimagePickerNext".
@userdar
"As soon as i choose image from library the quality goes from 100 to 10, why do you think it's happening i'm developing some kind of social media app so image quality is important"
target 'testPicker'
pod 'YPImagePicker',:git => 'https://github.com/Yummypets/YPImagePicker'
use_frameworks!
Hey! As someone fairly new to Swift, i have a trouble installing this library. Could anyone please help me out? (Preferably through cocoapods!)
Endless loading on attempt to load a slo-mo video recorded using native camera app
Currently in the SDK we've default options as either we can select images/videos from library or we can take it using camera. But it would be useful if SDK provides options so we can set only option from (library or photos or videos) for media selection.
Apologies beforehand as this is probably a dumb question with a simple solution.
Can you point me in the right direction for getting the selected photo and navigating to another VC by clicking on the 'Next' or 'Done' button? The best case scenario is the transition looks the same as the transition from initial image picker to the filter page.
I would also want the image to carry over to the other VC.
Thanks for any information you may have.
Where is the option for multiple selection of Image/Video?
Would be possible to force the app to crop the image to a square one from library to filter?
There,
i was having an issue while using your library, nothing happens when it comes to videos neither in the video capturing tab nor when we select a video from the photo album.
it starts the video capturing but on the stop button the video just gets vanished away and nothing significant happens, technically it should take the video to the filter view and then to the main view like instagram.
can you please look into this and help me out ?
thanks
It would be great to enable saving in the library the videos taken by the picker.
With the configuration below, after recording the video it's not saved as squared. When playing it back in an AVPlayerLayer it's in portrait mode.
Configuration:
var config = YPImagePickerConfiguration()
config.onlySquareImagesFromLibrary = true
config.onlySquareImagesFromCamera = true
config.showsVideo = true
config.showsFilters = false
config.videoCompression = AVAssetExportPresetPassthrough
config.libraryTargetImageSize = .cappedTo(size: mediaSize)
let picker = YPImagePicker(configuration: config)
Before starting the YPImagePicker from my app, I'm around 40MB of used memory (real device).
So, after opening, using some filters, dismissing a couple of times, the used memory is easily at 500MB.
Can you please look at this?
Now that I've used the library, where's the button to take a picture on the camera screen?
YPPickerVC.swift
func navBarTapped() {
let vc = YPAlbumVC()
vc.noVideos = !self.configuration.showsVideoInLibrary
let navVC = UINavigationController(rootViewController: vc)
vc.didSelectAlbum = { [weak self] album in
self?.libraryVC?.setAlbum(album)
self?.libraryVC?.title = album.title //add this code to fixed issue
self?.libraryVC?.refreshMediaRequest()
self?.setTitleViewWithTitle(aTitle: album.title)
self?.dismiss(animated: true, completion: nil)
}
present(navVC, animated: true, completion: nil)
}
Hello there, first of all i love your work. it's awesome and easy to customize. i want to create a custom rectangular (2:1 aspect ratio) crop area for certain use cases. (such as cover photos) can you implement such a feature maybe something like:
config.customCrop = true
config.cropRectangleRatio(width:1,height:2)
and maybe something like
config.cropCircle = true
can you walk me through or what is your opinion on the matter?
How to scroll up/down with rectangle video in library
I've created this issue in order to tell what i did updated for my project. And maybe something of this could be extracted to the public api.
Strings:
ypLocalized
strings.Images:
Different:
var config = YPImagePickerConfiguration()
config.screens = [.library, .photo]
let picker = YPImagePicker(configuration: config)
picker.didSelectImage = { [unowned picker] img in
}
Is there a way to avoid asking the permission (NSMicrophoneUsageDescription)? The lib should allow to pick images only
@s4cha
It takes around 7-8 seconds for the camera to display its content after displaying the YTImagePicker
, I'm using the default configuration.
let picker = YPImagePicker()
picker.didSelectImage = { [unowned picker] img in
self.imageView.image = img
picker.dismiss(animated: true, completion: nil)
}
picker.didSelectVideo = { [unowned picker] videoData, videoThumbnailImage in
self.imageView.image = videoThumbnailImage
picker.dismiss(animated: true, completion: nil)
}
present(picker, animated: true, completion: nil)
Preview:
https://imgur.com/a/3HktU
Devices: iPhone X, iPhone 7+
iOS: 11.2.5
Would this be possible in a future release? ๐
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.