I am using Fusuma for a image video application. I need all the assets(images and videos)of the camera roll. Here PHAsset is using for picking the assets. Here only gallery image is displaying. But I want to show all the images and videos in library section. Can any one please suggest me how can I modify the code for this?
There are 3 source types for apple to retrieve the photos from:
UIImagePickerControllerSourceType.PhotoLibrary
UIImagePickerControllerSourceType.Camera
UIImagePickerControllerSourceType.SavedPhotosAlbum
You can read more about them here: documentation
The PhotoLibrary is what you need to be accessing. If the API gives an option to access one of the two, choose it. If it doesn't, I would try to fork the repo with permission and make the change yourself. The user must give permissions to access the Library folder for you to access it, so be aware of that.
Related
The documentation indicates : pick a photo from library or camera roll and delete with user permission.
Is that possible using UIImagePickerController? Or does a user have to explicitly delete the selected photo?
This isn't possible regardless of what you use to try to accomplish it. The UIImagePickerController is only for choosing photos and does not modify them in any way. A more promising way, would be with the Assets Library but, even with this framework, you are unable to delete a users photos. That being said, if you want to use this functionality in your app, it will have to be for jailbroken devices only.
In short, the user has to navigate to the photos app and delete the images themselves.
Thanks to the iOS 8 Photos Framework, you can now delete images from the user library! I recommend you check out Apple's example app using the Photos Framework for a more detailed example of how to use it, but the relevant bit is:
//under SamplePhotosApp/AAPLAssetViewController.m
// Delete asset from library
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
[PHAssetChangeRequest deleteAssets:#[self.asset]];
} completionHandler:completionHandler];
where self.asset is a PHAsset object (which can be acquired in several ways) referring to the photo you wish to delete. Oh, and don't forget to import the Photos framework!
Hope this helps!
I know the various ways to save a UIImage to the photo library:
UIImageWriteToSavedPhotosAlbum
ALAssetsLibrary
However, my images are HUGE (60mb+), so bringing them into memory is not possible. I can download the images by streaming them to disk, and even use imageWithContentsOfFile to take a peek (although that is kind of unnecessary given screen size).
But I want the user to be able to save these images for later. Is there anyway for me to get these large images into the photo library? Do I just have to keep them stored locally inside the app sandbox?
I believe that there is no point at storing them at the photo library, since it is designed to be viewed on the device and theres no point at viewing an image so big. If you want to let the user see the image then i suggest you create a preview and save THAT version into the photo library. If you want to let the user transfer them from the device to the computer there is a special folder in your app bundle which will allow those pictures to appear when using itunes and selecting your application. then he can transfer those pictures to his computer. Also could you elaborate on the characteristics of the images? format, dimentions, purpose, etc.
I am creating a web service based iphone application in which a certain place i need to post an image on to the web for which i want to select image from photo gallery of phone and then i need to get the name and the path of the image on textfield and then uploading of the image.
or when pressing the browse button image picker will show all the image of the iphone and by selecting image it will return its path and name by which we can upload it.
Please check the similar question first.
To fully understand the answer you should also need to read UIImagePickerController Class Reference and ASIHTTPRequest documentation
As ASIHTTPRequest library is not supported more by its author, you may use another open source solution - AFNetworking or even the Cocoa classes, described in the URL Loading System Programming Guide
I haven't found any documentation on this or seen this done before, but is there anyway I can, instead of just choosing one image with UIImagePicker, load the user's albums, and then after selecting an image, that image displays, but also allows me to scroll left and ride to see all the images before and after that image?
I know I can use a multiple image picker, but that involves importing all the user's photos, and if the user has hundreds of photos, this would take a lot of time. I'm looking for similar functionality to the real photos app- the performance and everything. Any ideas?
Yes, you can. Look at the documentation for ALAssetsLibrary. This will allow you to enumerate all the user's image (and video) libraries. From this, you get ALAssets, which you can ask for their default ALAssetRepresentation. This one, in turn, you ask for its CGImage, from which you can create a UIImage.
Enumerating Libraries and Assets is done in blocks, which can easily be done in the background.
Use the assets library: http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html
An instance of ALAssetsLibrary provides access to the videos and
photos that are under the control of the Photos application.
The library includes those that are in the Saved Photos album, those
coming from iTunes, and those that were directly imported into the
device. You use it to retrieve the list of all asset groups and to
save images and videos into the Saved Photos album.
note: only available in ios 4+
I have been using UIPickerController to get the pics from my Built-in-Gallery into my own Application, But the issue is that the delegate related to that UIPickerCOntroller get only one pic at a time and returns me only one image. So i need to get the images one by one from PHotoGallery.
Now i want to implement my own Photo-Gallery so that i could get multiple images from Built-In photo Gallery.
Can you guys guide me how to access Builtin Gallery photo Folders and fetch all images from there into my Array so that i can make my own Photo Gallery with Multiple Selection Option
Or PLease tell me if i can manage the Multiple Selection Option from UIPickerController.
I guess Apple should provide us atleast this sort of feature that we can select multiple photos at a time from Photo gallery.
PLease guys Can u guide me with some code from any of these two Options
Thanks
you want to use the Assets Library framework. take a look at this blog post for more details:
http://www.fiveminutes.eu/accessing-photo-library-using-assets-library-framework-on-iphone/