save images from plist to gallery - iphone

plist file is stored in which pictures are displayed in scroll-view, made ​​button "save", need help with the code. PLEASE!!
to do so, that would "save" button, save pictures in which I am. For example: I'm on the picture number 5, touch "save" and picture number 5 save to the gallery, I'm on the picture number 21, touch "save" and picture number 21 save to the gallery

If you want to create some photo gallery apps, check out this open source sample.
Created by Michael Waterfall, which includes photo gallery from images stored on server or locally.
Download the plist from server & provide the urls to the gallery app in the required format, then show the gallery view as given in sample.
In order to save the image to users photo album, in the sample code the class PhotoBrowserController handles the gallery task, which has the indexes of the photos next, current, previous.
Using the image get the image from saved cache and save it to users photo album using
UIImageWriteToSavedPhotosAlbum(saveImage,self,nil,nil);
Look at the sample app & go through the flow you will come to know how can modify for your requirements.

Related

How to get path of images with IOS 16 image picker SwiftUI

Good day,
How do I get the path of images from the ios 16 Photos Picker(PhotosUI Library) as I am trying to store the path in a json file to retrieve later to display
I have a form with a image picker and I want to store the path in json file and then later retrieve the path from the json file to show the image on another view.
There are no images and no paths. The photo library is a database.
You can get the photo asset's identifier if you have permissions, and then you can use that elsewhere to fetch the same photo from the database.

Camera Roll asset images not available after saving an image to Saved Photos

I am using ALAssetsLibrary to make an array of all images in the camera roll when my iPhone app starts. I store every image as a ALAsset * in an array.
Later in the app, I am saving an image to the gallery using this:
UIImageWriteToSavedPhotosAlbum(croppedImage, self, #selector(image:didFinishSavingWithError:contextInfo:), nil);
The image is saved successfully to the saved photos album. But, now my problem is that when I try to retrieve images using the existing array of all images, I don't get anything. Do I need to build the array of all images again or is there some other way to do this?
Saving an image changes the library and invalidates objects like assets from the library. You need to reload assets from the library whenever the library changes - do that when you receive an ALAssetsLibraryChangedNotification.

uiimagepickercontroller video duration - photo library

Am developing a app which will upload video to the server which is picked form local iphone photo library.
here i want to restrict the user not to upload more than 3min of video..Question is how to get the duration of the video which is picked from local photo library using uiimagepickercontroller.
will it contain any property for that..?
Thanks
I am not sure but did u try imagePickerController.videoMaximumDuration = urDuration;
You can get the size of your videofile.If you want to put check according to the size that is possible or you can get the duration by using mpmovieplayer class but for that you have to get the full video file .I dont think so you want to do this so its gud if you can put a check according to the size.

Is there a way to get paths of all the images of CAmera roll

Is there any way to create an array or something
having paths of all the images stored in camera roll.
Please enlighten me on this.
Thnx in advance
SpyPhone uses a direct path to the users photo library:
http://github.com/nst/spyphone/
It seems that any application can read it. However, this seems like falls under the area of "undocumented API" and could well be rejected in a real application.
I don't think there is. As far as the API is concerned for the UIImagePickerController you can only get a single path for a Movie that was recorded by the user (if running 3.0 on a 3GS). And even that path is a file URL to the temporary folder where the movie is stored before being written to the library.
You can't get paths for any images in the photo library or the camera roll.
When you pick an image using the UIImagePickerController the controller returns the Original Image and an "Edited Image" if the image was edited before being chosen.

Save photo to iphone camera roll with a custom name

I am trying to save a photo taken from my app to camera roll, this can be done by using UIImageWriteToSavedPhotosAlbum, however, I noticed there isn't any way to set the photo name by using this approach, am I right?
I also tried to save a image file with a name by using UIImageJPEGRepresentation, however, I can only save it to my app's document folder but not camera roll.
Is there any way to save photo to camera roll with a custom name?
Thanks advance for your kindly help.
John
no, no way to save with a custom name to the camera roll.
There is a way to kinda do that, by setting the image metadata:
if you set the IPTC metadata field "Object Name", this will be shown as the image title in iPhoto.
See details (and code) at http://ootips.org/yonat/how-to-set-the-image-name-when-saving-to-the-camera-roll/ .