iPhone: Can I get an image picker to have the documents folder as its source - iphone

It looks like I cant create an album for my picture producing app in the photo library... so what I was going to do is save the images to the documents folder for my app, which I think should be easy enough. The issue though is that the image picker seems to only allow you to pick saved images or photo library as the source, and I would like users to be able to view all images created by my app. Is there a way to make the picker work or will I have to roll my own?

the image picker that apple provides only gives you access to pictures saved in the camera roll. It also gives you the functionality to take a new picture if you are on an iphone. If you save pictures in your app's local storage directory, then you need to build your own mechanism for viewing these photos. You may want to take a look at Joe Hewitt's 320 project - it has a lot of good controls that you may find useful.

Related

Want to store photos like photo application

I would like to store severals photos like photo application, however i don't know exactly the objects what i need. If anyone know how to implement this way i'm interested.
A link to give you an idea: http://blog.photobox.fr/wp-content/uploads/2010/07/Album-iPhone5.jpg
thank you in advance.
You can try the PhotoViewer provided in three20 framework. It is exact replica of the Photos app of iPhone, if that's what you're looking for. You can find a tutorial here.
go to this link it help u
https://github.com/kirbyt/KTPhotoBrowser
Having spoken to an Apple engineer on some of the optimizations that they went through on the Photos app, I can give you a couple of tips:
They never display back the original photo. Because of a photo's size, they only take the original photo and save off a number of optimized thumbnail images.
The example image you show does not contain a series of thumbnail images. Each row is actually a single image. For selection, an overlay is placed in the exact size and dimension of the thumbnail image to give the impression that you are selecting a particular image. This could be accomplished by using a table view, but it more likely just a scroll view.

Photo browser with previous and next button , how?

I want to make a gallery with previous and next button in my iPhone app.
If anyone has idea , link , exampler or something that lead me to implement the gallery please provide me .
I've written a simple and easy to use photo browser called MWPhotoBrowser. I decided to create it as Three20, while very good, was too heavy/bloated as all I needed was a photo viewer.
It is an implementation of a photo viewer that I wrote allowing the user to view one or more images in a similar way to the native Photos app. It can display one or more images by providing either UIImage objects, file paths to images on the device, or URLs images online. Photos can also be zoomed, panned, and navigated with previous/next buttons.
View MWPhotoBrowser on GitHub
Hope this helps!
Thee20 framework, they have a great gallery example

Linking to selected photos

If I allows users to select photos and need to store those selections (in a database), can I store a link to the selected photo or do I need to grab the image and store it in the app's Documents folder? The latter doesn't seem practical since it will cause the image to neednessly take up double the amount of space.
I'm familiar with UIImagePickerControllerDelegate but not sure how to obtain a reliable reference to an image that sustains across application restarts. There is probably the concern that the link can break if the user deletes that image from their photo library. Is there a way to check that?
There is no way to get a file url to an image stored in the Photo Library.
If you really do need to keep a reference to the file for programatic reasons, then choosing the image from UIImagePickerController and saving a copy to the Documents folder is probably your only option.
It would help if we could understand why you require a file reference to the image. As far as the iPhone is concerned, the image is safe and sound in the photo library, if user needs it, it can be picked from the image picker, like normal.
However, if you're trying to use it for a customisable background or something, then I think saving a copy is your only option.

How to make UI Image Picker Controller read a custom source type in iPhone

I have to create a photo gallery app in iPhone. It should function same as the Photos app which is shipped with iPhone. But it should show the images which I package with the app.
UIImagePickerController reads only the following source types.
UIImagePickerControllerSourceTypePhotoLibrary,
UIImagePickerControllerSourceTypeCamera,
UIImagePickerControllerSourceTypeSavedPhotosAlbum
I was thinking of adding the images bundle to the resources group in Xcode and make UIImagePickerController to read them and display.
Looking at the class references I found UIImagePickerController reads only from the resources mentioned above. Which means it can only pick the images from camera roll OR saved photo gallery OR allow user to take a pic and use it.
Does anybody know how to make UIImagePickerController read from custom source type or images?
OR
How to create a photo gallery app in iPhone :-)
Thanks,
AJ
I don't believe it is possible to make the UIImagePicker pick images from your own source. You will have to write the picker yourself (which, performance aside, doesn't seem to hard... Just a couple of UIImageViews in a UIScrollView).
Just today I started a open source UIImagePickerController clone, it is not perfect but it works quite ok. Feel free to fork http://github.com/jeena/JPImagePickerController

How do I prompt a user to select an image on the iPhone?

I would like to allow the user to select one of several pre-supplied images. Is there a standard way to do this?
The only thing similar to this that is Standard would be the Image Picker control.
However for this to work you would have to add your images to the iPhone's image library and the user would have to pick them from out of all their other pictures.
What you need to do is build something similar.
You can go as easy or complex as you need/want.
I would go simple (as that is the idea of the iPhone) and have a scroll view (depending on the number of pictures you want) and load thumbnails of the images. When they select one, you do something with it. (Look at the view when you are looking in a photo album on the iphone)
I believe I have seen open-source representations of this before.
I would check google code.
I use a UITableView for this, with a thumbnail and description of the image they're choosing.