Coder Social home page Coder Social logo

qbimagepicker's Introduction

QBImagePicker

Carthage compatible

A clone of UIImagePickerController with multiple selection support.

screenshot01.png screenshot02.png

Features

  • Allows multiple selection of photos and videos
  • Fast and memory-efficient scrolling
  • Provides similar user interface to the built-in image picker
  • Customizable (grid size, navigation message, etc.)
  • Supports both portrait mode and landscape mode
  • Compatible with iPhone 6/6Plus, and iPad

Requirements

  • Version >= 3.0.0 : iOS 8 or later (Using PhotoKit)
  • Version < 3.0.0 : iOS 6 or later (Using AssetsLibrary)

Example

QBImagePickerController *imagePickerController = [QBImagePickerController new];
imagePickerController.delegate = self;
imagePickerController.allowsMultipleSelection = YES;
imagePickerController.maximumNumberOfSelection = 6;
imagePickerController.showsNumberOfSelectedAssets = YES;

[self presentViewController:imagePickerController animated:YES completion:NULL];

Installation

CocoaPods

  1. Add pod "QBImagePickerController" to Podfile
  2. Run pod install
  3. Add #import <QBImagePickerController/QBImagePickerController.h> to your code

Carthage

  1. Add github "questbeat/QBImagePicker" to Cartfile
  2. Run carthage update
  3. Add #import <QBImagePicker/QBImagePicker.h> to your code

Usage

Basic

  1. Implement QBImagePickerControllerDelegate methods

  2. Create QBImagePickerController object

  3. Set self to the delegate property

  4. Show the picker by using presentViewController:animated:completion:

    QBImagePickerController *imagePickerController = [QBImagePickerController new]; imagePickerController.delegate = self;

    [self presentViewController:imagePickerController animated:YES completion:NULL];

Delegate Methods

Getting the selected assets

Implement qb_imagePickerController:didFinishPickingAssets: to get the assets selected by the user.
This method will be called when the user finishes picking assets.

- (void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didFinishPickingAssets:(NSArray *)assets {
    for (PHAsset *asset in assets) {
        // Do something with the asset
    }

    [self dismissViewControllerAnimated:YES completion:NULL];
}

Getting notified when the user cancels

Implement qb_imagePickerControllerDidCancel: to get notified when the user hits "Cancel" button.

- (void)qb_imagePickerControllerDidCancel:(QBImagePickerController *)imagePickerController {
    [self dismissViewControllerAnimated:YES completion:NULL];
}

Getting notified when the selection is changed

You can handle the change of user's selection by implementing these methods.

- (BOOL)qb_imagePickerController:(QBImagePickerController *)imagePickerController shouldSelectAsset:(PHAsset *)asset;
- (void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didSelectAsset:(PHAsset *)asset;
- (void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didDeselectAsset:(PHAsset *)asset;

Customization

Selection mode

When allowsMultipleSelection is YES, the user can select multiple photos.
The default value is NO.

imagePickerController.allowsMultipleSelection = YES;

You can limit the number of selection by using minimumNumberOfSelection and maximumNumberOfSelection property.
The default value is 0, which means the number of selection is unlimited.

imagePickerController.minimumNumberOfSelection = 3;
imagePickerController.maximumNumberOfSelection = 6;

Specify the albums to be shown

Use assetCollectionSubtypes property to specify the albums to be shown.
The code below shows the default value.

imagePickerController.assetCollectionSubtypes = @[
    @(PHAssetCollectionSubtypeSmartAlbumUserLibrary), // Camera Roll
    @(PHAssetCollectionSubtypeAlbumMyPhotoStream), // My Photo Stream
    @(PHAssetCollectionSubtypeSmartAlbumPanoramas), // Panoramas
    @(PHAssetCollectionSubtypeSmartAlbumVideos), // Videos
    @(PHAssetCollectionSubtypeSmartAlbumBursts) // Bursts
];

The albums will be ordered as you specified.
User's albums are always shown after the smart albums.

Specify the media type to be shown

Use mediaType to filter the assets to be shown.
The default value is QBImagePickerMediaTypeAny.

imagePickerController.mediaType = QBImagePickerMediaTypeVideo;

Showing information

There are some properties to show helpful information.

imagePickerController.prompt = @"Select the photos you want to upload!";
imagePickerController.showsNumberOfSelectedAssets = YES;

Grid size

Use numberOfColumnsInPortrait and numberOfColumnsInLandscape to change the grid size.
The code below shows the default value.

imagePickerController.numberOfColumnsInPortrait = 4;
imagePickerController.numberOfColumnsInLandscape = 7;

License

Copyright (c) 2015 Katsuma Tanaka

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

qbimagepicker's People

Contributors

anasb avatar benguild avatar bwilczynski avatar cjimenezpacho avatar ianhoar avatar jiehu5114 avatar julien-c avatar kelp404 avatar knutigro avatar mironal avatar mnloop avatar nek023 avatar satoship avatar siuying avatar streeter avatar tobihagemann avatar yimingtang avatar yoichitgy avatar zjmdp 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar

qbimagepicker's Issues

done button not called

select photos and click done button, but the delegate not call, the done action also not call

Auto deselect.

Hi, Thanks a lot for your code.

I have a little suggest.

imagePickerController.allowsMultipleSelection = YES;
imagePickerController.minimumNumberOfSelection = 1;
imagePickerController.maximumNumberOfSelection = 1;

In this kind of case, when selecting a new picture can you make it deselect the old one automatically?
Then the user can select the new one without deselecting the old one before.
Because before tap the done button, user maybe change mind when scrolling.

Crash in - [QBAssetsViewController photoLibraryDidChange:] in QBAssetsViewController.m, line 403

Info: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete and reload the same index path (<NSIndexPath: 0x18a62f00> {length = 2, path = 0 - 94})'

Exception Type: SIGABRT

Hardware Model: iPad3,4
OS Version: iPhone OS 8.4 (12H143)

Exception Type: SIGABRT
Exception Codes: #0 at 0x316addf0
Crashed Thread: 0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete and reload the same index path (<NSIndexPath: 0x18a62f00> {length = 2, path = 0 - 94})'

Last Exception Backtrace:
0 CoreFoundation 0x22973fef exceptionPreprocess + 127
1 libobjc.A.dylib 0x31031c8b objc_exception_throw + 36
2 CoreFoundation 0x22973ec5 +[NSException raise:format:arguments:] + 102
3 Foundation 0x23673f17 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 88
4 UIKit 0x265f0711 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:] + 1342
5 UIKit 0x265f492f -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 404
6 UIKit 0x265f4793 -[UICollectionView _performBatchUpdates:completion:invalidationContext:] + 28
7 UIKit 0x261b1617 -[UICollectionView performBatchUpdates:completion:] + 28
8 Foap 0x002b6b01 __48-[QBAssetsViewController photoLibraryDidChange:]_block_invoke (QBAssetsViewController.m:403)
9 libdispatch.dylib 0x315c22e3 _dispatch_call_block_and_release + 8
10 libdispatch.dylib 0x315c22cf _dispatch_client_callout + 20
11 libdispatch.dylib 0x315c5d2f _dispatch_main_queue_callback_4CF + 1328
12 CoreFoundation 0x22939609 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 6
13 CoreFoundation 0x22937d09 __CFRunLoopRun + 1510
14 CoreFoundation 0x22884201 CFRunLoopRunSpecific + 474
15 CoreFoundation 0x22884013 CFRunLoopRunInMode + 104
16 GraphicsServices 0x2a243201 GSEventRunModal + 134
17 UIKit 0x26050a09 UIApplicationMain + 1438
18 Foap 0x0003b2ab main (main.m:15)
19 libdyld.dylib 0x315e3aaf start + 0

iOS8 - Deleted Images function creates NSRangeException when selecting Camera Roll

I'm getting this NSRangeException (and the app locks up) when I use the QBImagePicker and select my Camera Roll.
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 28 beyond bounds [0 .. 27]'

When I select Camera Roll in my QBImagePicker, this exception is raised and the app stops responding.

They symptoms & cause of the issue are below:

  • in QBImagePicker, the Camera Roll row says there are 37 images.
  • In my actual camera roll, there are only 28 images, + 9 in the Recently Deleted 'album' (which totals 37)
  • So, because the picker is looking for 37 images, but in the album proper there are only 28, that relates directly to the NSRangeException.
  • If I go and 'Delete All' from the Recently Deleted album, the issue is resolved.

Once again, Apple have gone and stuffed it - those Deleted Photos really shouldn't be counted in a normal API call to get the Photo Album, but hey... here we are, and it'll need a bit of a workaround maybe.

Thanks (great controller by the way).

my Xcode version is 4.6.3, Can i use QBImagePickerController

my Xcode version is 4.6.3, Can i use QBImagePickerController?? please help me! thank you very much, there is no xcTestFramewrok in my Xcode, if i run my project in Xcode 5.0 ,if will report error like this ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

crash bug

Hi.

In QBImagePickerController class where you init controller you use
self.groupTypes = @[
@(ALAssetsGroupSavedPhotos),
@(ALAssetsGroupPhotoStream),
@(ALAssetsGroupAlbum)
];
The "ALAssetsGroupPhotoStream" value causes crash because it was deprecated (iOS 5.0)

Ability to Refresh TableView

Hi

Can I request a feature to be added so as you can Refresh the tableview for instance when a new photo is taken ?

Thanks,
Michael

Not sorting photos exactly like native photoapp

I have noticed that QBImagePicker not has exactly same sorting as in the native iOS photoapp.

Lets say I edit a photo in Camera+ app and save it back to gallery.
In the native photopicker the photo I edited and saved will be down at the bottom since it was the last one I changed. The original will be at its original place according to its creation date.

In QBImagePicker the photo I edited will be just after at it's original according to it's original creation date.

Only "Recently Added" photos can be selected

I am using Xcode6 ios swift and the simulator device is iphone 6 plus. I found that QBImagePickerController can only show "Recently Added" photos when selecting the images. The other albums were missing.

Cannnot run on simulator

Whenever I try to run the picker on the simulator, I get apple Mach-O-Link error. This is the warning:

ignoring file /Users/roeik/Library/Developer/Xcode/DerivedData/QBImagePicker-echovqawkwxhtfbqzjlyhyemcfra/Build/Products/Debug-iphoneos/QBImagePicker.framework/QBImagePicker, file was built for arm64 which is not the architecture being linked (x86_64): /Users/roeik/Library/Developer/Xcode/DerivedData/QBImagePicker-echovqawkwxhtfbqzjlyhyemcfra/Build/Products/Debug-iphoneos/QBImagePicker.framework/QBImagePicker

Also, when I run on the device the project built ok but the thumbnails in the picker are low res and blurry. What to do?
I just built the framework in the demo proect and dragged it. Please help.

Undefined symbols for architecture x86_64

I've compiled the framework with default settings, imported it into my project (default iOS architecture). I do have two different Bridging-Header files for the App and its WatchKit Extension. I #import the framework in the App target only.
I got an Apple Mach-O Linker Warning:
missing required architecture x86_64 in file
... /Frameworks/QBImagePicker.framework/QBImagePicker (2 slices)
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_QBImagePickerController", referenced from:
__TMaCSo23QBImagePickerController in GCFoto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas?

How can i remove a selected asset by program?

I use a collectionView to show what the asset user selected. when user tap the cell in collectionView, i want to unselected a asset in QBImagePicker. At now, i open QBImagePicker, previous selected asset is always selected if you never touch it in QBImagePicker.

Set maximumNumberOfSelection crash

set "maximumNumberOfSelection" crash

imagePickerController.allowsMultipleSelection = YES;
imagePickerController.limitsMaximumNumberOfSelection = YES;
imagePickerController.maximumNumberOfSelection = 10;

photos in album is less than setting, crash to choose last picture.
and, photo setting count and selected Large than one setting, crash to choose the image of the other.

Launching DemoApp crash in ios7 and ios8

Launching demo, when select an album the app crash with this error:
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithFormat:locale:arguments:]: nil argument'
*** First throw call stack:

the line that cause error is:

footerView.textLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTableInBundle(format,
@"QBImagePickerController",
[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"QBImagePickerController" ofType:@"bundle"]],
nil),

The returned bundle is always nil

add new simplified Chinese into Pods>QBImagePickerController>Resources, app crash

I need to localize the language into simplified Chinese. And I did the following:

  1. Clone the repo down on local disk, and it's already been localized and contains a zh-Hans.lproj folder.
  2. I copied the folder into Pods project > Pods > QBImagePickerController > Resources. It appears in the catalog and also in the same folder as ja.lproj
  3. Directly run the build on device, it works well.
  4. Archive the build and download it from a webpage and install, it will crash when enter into imagePicker.

I cannot figure it out why it will crash. please help or give me some hints. Thanks!!

crash open a big size size image

crash open big file size image.
file size of data checked the 25MB.

crash point,

QBImagePickerController.m

-(NSDictionary *)mediaInfoFromAsset:(ALAsset *)asset

[mediaInfo setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullResolutionImage]] forKey:@"UIImagePickerControllerOriginalImage"];

It blocks UI if I pick many photos

- (void)assetCollectionViewController:(QBAssetCollectionViewController *)assetCollectionViewController didFinishPickingAssets:(NSArray *)assets
{
    if([self.delegate respondsToSelector:@selector(imagePickerControllerWillFinishPickingMedia:)]) {
        [self.delegate imagePickerControllerWillFinishPickingMedia:self];
    }

    if([self.delegate respondsToSelector:@selector(imagePickerController:didFinishPickingMediaWithInfo:)]) {
        NSMutableArray *info = [NSMutableArray array];

        for(ALAsset *asset in assets) {
            [info addObject:[self mediaInfoFromAsset:asset]]; 
        }

        [self.delegate imagePickerController:self didFinishPickingMediaWithInfo:info];
    }
}

- (NSDictionary *)mediaInfoFromAsset:(ALAsset *)asset
{
    NSMutableDictionary *mediaInfo = [NSMutableDictionary dictionary];
    [mediaInfo setObject:[asset valueForProperty:ALAssetPropertyType] forKey:@"UIImagePickerControllerMediaType"];
    [mediaInfo setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]] forKey:@"UIImagePickerControllerOriginalImage"];
    [mediaInfo setObject:[[asset valueForProperty:ALAssetPropertyURLs] valueForKey:[[[asset valueForProperty:ALAssetPropertyURLs] allKeys] objectAtIndex:0]] forKey:@"UIImagePickerControllerReferenceURL"];

    return mediaInfo;
}

The line of code [info addObject:[self mediaInfoFromAsset:asset]]; takes long time because you try to get an UIImage object from every ALAsset object in the array. This is on main thread, so it blocks UI after the user click done button.

My suggestion is you just return ALAsset array. Let the delegates do whatever they like. Maybe asynchronous tasks.

Number Of assets toolbar covering bottom part of last images

Hello. First of all, let me tell you , nice component, I really like it.
Second.. I have a situation here, I'm pretty sure is an easy fix. When the picker pushes some album for first time, the collection is scrolled to the bottom, which is great, but once I select an image, the toolbar with the number of selected assets covers half of the last row. See Image. So user has to scroll it manually to see again the full thumbnails.

screen shot 2015-06-30 at 14 12 10

Create a Delegate to ask if user can select a particular photo

Hello, first of all great work!

I was wondering if you can enforce a delegate that asks if a user is allowed to select a particular photo. The use case is that I have a camera within my app that I consume the image directly from and I also have, through you library, a way for the user to select photos. However, I want to prevent him selecting the same photos twice (the one taken through the camera from within my app, and from the camera roll). A simple method called shouldSelectPhoto and didSelectPhoto will open up interesting use cases to developers. Do let me know if this is possible, I don't mind contributing to it either.

Thanks a lot and great work once again!

Why PhotoKit

Hello questbeat, I don't find anything diff between PhotoKit and AssetLibrary, Why to use PhotoKit on iOS8 instead of AssetLibrary, what do you think?

Installed via CocoaPods, stuck in Japanese

I've installed v2.5.1 through CocoaPods, since my app needs to support iOS 7. Now, whenever I display the picker, the title is always アルバム. My project is all-English and does not have any kind of i18n code in it.

I did have a Japanese keyboard added in Settings, which I removed, and the issue continues. It also happens on the simulator.

How can I force QBImagePickerController to display only in English?

よろしくお願いします。😀

QBImagePickerController forces width?

I am pushing it to a iPad Popover and setting the width to 800. But once I select the album it changes the width of the view to be much smaller. Is there a way to keep it at 800? I can't find the location in the code to get it to work.

Thanks for the great ImagePicker though, very extensible.

iOS 6.0 support in cocoapods

Hi,

Is it possible to update the deployment target to 6.0 instead of 6.1 ? Pods complains about it unless I specify the target to be 6.1 in my podfile.

 [!] The platform of the target 'Pods' (iOS 6.0) is not compatible with 
'QBImagePickerController (2.1)' which has a minimum requirement of iOS 6.1.

QBImagePickerController 2.0 not support imagePickerController.clearsSelectionOnViewWillAppear = YES;//default is YES

so my solution way :
in QBAssetsCollectionViewController viewWillAppear: method
add
if (_imagePickerController.clearsSelectionOnViewWillAppear) {
// DLog(@"%@",self.collectionView.indexPathsForSelectedItems);
for (NSIndexPath *path in self.collectionView.indexPathsForSelectedItems) {
[self.collectionView deselectItemAtIndexPath:path animated:NO];
[self DeSelectImageWithIndexPath:path];
}
}

the [self DeSelectImageWithIndexPath:path]; method is

  • (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath method content.

end.

pragma mark seasun 增加打开图片库时取消选择(一般用于多次打开图片库),在viewWillAppear调用一次

  • (void)DeSelectImageWithIndexPath:(NSIndexPath *)indexPath{
    ALAsset *asset = [self.assets objectAtIndex:indexPath.row];

    // Validation
    if (self.allowsMultipleSelection) {
    self.navigationItem.rightBarButtonItem.enabled = [self validateNumberOfSelections:(self.imagePickerController.selectedAssetURLs.count - 1)];
    }

    // Delegate
    if (self.delegate && [self.delegate respondsToSelector:@selector(assetsCollectionViewController:didDeselectAsset:)]) {
    [self.delegate assetsCollectionViewController:self didDeselectAsset:asset];
    }
    }

ios 8 crash when launching image picker

Hi,

Been using your controller and works great in ios 7. In ios 8 same code the image picker always crashes before loading the photo albums:

2014-08-07 18:53:00.082 MYAPP[817:434075] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(0x2be89e2f 0x38f2ac8b 0x2bd9ee8d 0x54d3b 0x2f500251 0x2eede795 0x2eec81f3 0x2efaaf69 0x2eec79d1 0x2eec7681 0x2eeabb51 0x2eeab815 0x2eeab1f1 0x2eeaaff5 0x2eea4ecd 0x2be505bd 0x2be4dc7b 0x2be4e083 0x2bd9c611 0x2bd9c423 0x332f60a9 0x2f4e6485 0x2ea6d 0x394b0aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException

Appears to be QBImagePickerThumbnailView crashing around this point:

UIImage *thumbnailImage = [self.thumbnailImages objectAtIndex:0];

CGRect thumbnailImageRect = CGRectMake(0, 4.0, 70.0, 70.0);
CGContextFillRect(context, thumbnailImageRect);
[thumbnailImage drawInRect:CGRectInset(thumbnailImageRect, 0.5, 0.5)];

The last issue posted mentions due to the Recently Deleted album introduced in ios 8, but I tried after emptying this album and it still crashes. Any ideas? Thanks!

ra

Edit Phoo Selection?

Nice Job!
Quick question, if after the user selected images he wants to open the picker again and edit his selection, how is it possible to achieve? (similar to whatsapp?)
Is there a way to give back the picker the PHAsset array?

Also, on another note, is there a way to convert PHAsset to UIImage synchronously?
Thank you

How to get selected video file's absolute path

I am trying to use this control in my app, In my app i have to upload the selected videos and images to server. when uploading images there is no problem because i can get the raw image from didFinishPickingMediaWithInfo delegate method so i will save that raw image in a particular path then i will send that path to server. But when i am trying upload video file i am facing problem because it does not return uiimagepickercontrollermediaurl. How can i get the file path of selceted video file? Please guide me

iOS 8.1 Crash when I select a video or a photo on 'My Photo Stream'

Hi
To reproduce the crash:
1 - Add some photos (or videos)
2 - Open QBImagePicketController
3 - Select 'My Photo Stream'
4 - Select a photo
5 - Click on 'Done'
It will crash at line 263 on QBImagePickerController.m method passSelectedAssetsToDelegate.
At line 263 asset variable is nil.
My config:
Xcode Version 6.1 (6A1052d)
iPhone 6+ on iOS 8.1 (12B411)

iOS7

Can you please update it for iOS7?
Currently it looks like this:
ios simulator screen shot sep 22 2013 11 40 19 pm
ios simulator screen shot sep 22 2013 11 40 24 pm

How to get selected video file's path to upload?

I want to choose video to upload,but the delegate method

  • (void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didSelectAssets:(NSArray *)assets
    does not return uiimagepickercontrollermediaurl like UIImagePickerController.
    How to get video file path?

Is there any example to get image back in delegate method with new API?

Hi questbeat i am a new guy for developing ios,
Is there any example to get image back in delegate method with new API?

#pragma mark QBImagePickerControllerDelegate
- (void)qb_imagePickerController:(QBImagePickerController *)imagePickerController didFinishPickingAssets:(NSArray *)assets{
     for (PHAsset *asset in assets) {

         PHAsset *asset =   // how can i get back image???
          .....
         _myImageView.image=highQualityImage;
     }
    [self dismissViewControllerAnimated:YES completion:nil];
}

Missing images/albums/library

I tried including every type from the Apple Documentation, ... except the video and hidden types:

[imagePickerController setAssetCollectionSubtypes:@[
                @(PHAssetCollectionTypeAlbum),
                @(PHAssetCollectionTypeSmartAlbum),
                @(PHAssetCollectionTypeMoment),
                @(PHAssetCollectionSubtypeAlbumRegular),
                @(PHAssetCollectionSubtypeAlbumSyncedEvent),
                @(PHAssetCollectionSubtypeAlbumSyncedFaces),
                @(PHAssetCollectionSubtypeAlbumSyncedAlbum),
                @(PHAssetCollectionSubtypeAlbumImported),
                @(PHAssetCollectionSubtypeAlbumCloudShared),
                @(PHAssetCollectionSubtypeSmartAlbumGeneric),
                @(PHAssetCollectionSubtypeSmartAlbumPanoramas),
                // @(PHAssetCollectionSubtypeSmartAlbumVideos),
                @(PHAssetCollectionSubtypeSmartAlbumFavorites),
                @(PHAssetCollectionSubtypeSmartAlbumTimelapses),
                // @(PHAssetCollectionSubtypeSmartAlbumAllHidden),
                @(PHAssetCollectionSubtypeSmartAlbumRecentlyAdded),
                @(PHAssetCollectionSubtypeSmartAlbumBursts),
                // @(PHAssetCollectionSubtypeSmartAlbumSlomoVideos),
                @(PHAssetCollectionSubtypeAny)
            ] ];

Still, no matter what I've tried, it won't show all of the standard stuff from UIImagePickerController or that is synced from iPhoto. Basically all of my photos aren't there. Is this a behavior of the "PH" stuff, or am I missing something here?

Crashes if there is no Asset in folder

Hi
First of all, thanks for the wonderful artifact.
I observed on issue on iOS8.3 SDK, Probably previous version of SDK.
If there is no asset in folder(Album), line 373 in QBAssetsViewController.m throws an exception.
It tries to access an item that does not exist. PHFetchResult contains nothing.

strange problem with navigationController

Hi, I'm trying to use your wonderfull library, when I used it on a new test project it worked like a charm. the problem is when I try copiying to my official project xhere I need it, it displays the albums correctly, but whenever I select an album, it don't show the thumbs unless I scroll manually the tableView ! May be I'm doing some wrong steps, So here is the code :

QBImagePickerController *imagePickerController = [[QBImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.allowsMultipleSelection = YES;

imagePickerController.limitsMaximumNumberOfSelection = YES;
imagePickerController.maximumNumberOfSelection = 6;
imagePickerController.fullScreenLayoutEnabled=NO;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:imagePickerController];

[self presentViewController:navigationController animated:YES completion:NULL];

Please Any idea? I'm so stressed to finish my project? Thanks.

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.