Save photo to iphone camera roll with a custom name - iphone

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/ .

Related

Save a UIImage to a different name

I am writing an application which lets the user pick one photograph from a selection. Then I want to save that photograph to their photo roll to a specific name. i.e I always want the photo in the roll to be named the same thing and overwrite previous selections.
UIImage* image = [UIImage imageNamed:[ImageNames objectAtIndex:self.miImage]];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
I can't find anyway to make a copy of the image and assign a new name to it, or specify a target name for UIImageWriteToSavedPhotosAlbum().
Is there any way to do this?
thanks in advance,
Jay
You cannot specify a filename when using UIImageWriteToSavedPhotosAlbum because it saves the image to the Camera Roll (or the Photos Library, if the device does not have a camera). This allows the system to assign it a name based on a format, like "DSC0001.jpg" or similar, and avoid name collisions.
Because of this, overwriting an image is also not possible, since the Photo Library / Camera Roll are controlled by the user - a user that would not appreciate a photo being overwritten by your application.
...writing the image to the user’s Camera Roll or Saved Photos album.
UIImageWriteToSavedPhotosAlbum Reference

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 any standard fileopen dialog in iphone programming?

I want to create application, that will process images(mostly - photographs from mobile camera).
So i need at first to provide the way to open image file from phone memory.
how can i do that?
Sorry for such a stupid question, but i am newbie in iphone programming(yet:)).
P.S. I use xcode, cocoa
You can use UIImagePickerController to get a standard interface for selecting a photo from the user's library or camera roll. Depending on the configuration, it can also be used to capture a new image with the camera. Note however that you get a UIImage back, not a file, if you want to upload it somewhere, you will first have to create a file or NSData object from the image, using either UIImagePNGRepresentation() or UIImageJPEGRepresentation().

iPhone UIImagePickerController file name

after getting a selected image in didFinishPickingImage:, is there a way to get the filename or name of that image? Is there any string that uniquely identifies that image or that is saved with the image at the moment image was added to the photo album?
You can check the metadata, but from my tests the title does not seem to be there or anywhere else.

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.