Sharing an image using parse.com - iphone

I would like to share an image between two users using parse.com. My original idea was to simple pass the image url from the first user to the second to view/download. I have no issue uploading the image to parse.com , however I can't work out how to return the url. Is it possible to return the url?
There seems to be a solution for this on android Get link to image file at Parse.com but I can't find one for iphone.
Thanks in advance

In the Image save example of Parse.com, I found the image url.
In - (void)setUpImages:(NSArray *)images method,
PFFile *theImage = [eachObject objectForKey:#"imageFile"]; will return image file object with its URL.
Hope this will help you.

Related

How to get big facebook video thumbnail

I'm looking for the way to get big facebook video thumbnail.
i've found some links:
http://graph.facebook.com/1571886379501082/picture
~> this one retun one small thumbnail picture with size 128x128.
and other one
http://graph.facebook.com/1571886379501082/thumbnails
~> this one will return big thumbnail picture but it required access_token to get.
is it possible to get big thumbnail video picture without login on facebook?
When the first URL is hit, the link is refering to
https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xfa1/v/t15.0-10/p128x128/10876207_805883852835396_1769147834_n.jpg?oh=a755047c692902070f8d9bd79ce28453&oe=56396042&gda=1451498989_6c4cbd42045490d0935990d6627905ed
For large thumbnail you have to change the size 128x128 to 552x414
https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xfa1/v/t15.0-10/s552x414/10876207_805883852835396_1769147834_n.jpg?oh=09f92535e931ff2269a7ae4d31c03d5b&oe=563FEF44&gda=1451103467_d60d0b95c7e93f9c9046a0eeeca24c5e
Kindly figure out with regular expression or something else for proper usage but the above URL works for me.
This method will create an object array and seek the last key of the format, which is the big image.
$fb = file_get_contents('http://graph.facebook.com/1246538155392772');
$fb = json_decode($fb);
//---find the big image which is always last in array
$key = count($fb->format)-1;
$bigimg = $fb->format[$key]->picture;
echo '<img src="'.$bigimg.'" />';
If you just want to get the image for simple posting, just use this tool. Get Facebook Video Images

Getting difficulty in reading image from Disk for iphone in Unity

I am developing a unity app, in which i call webservice for image url and after getting those url, i call one by one url for image downloading and store those images onto disks, and after in some point i read those images from disks and show as texture, but i am getting problem in reading images. It show me Question mark on texture and when i dig more to find out problem i got that i am getting zero of image using www.size and text also nil using www.text. I am doing following for reading and writing images.
Writing
if(wwwMarker.isDone)
File.WriteAllBytes(Application.persistentDataPath + "/"+ data.markerName + ".jpg", wwwMarker.bytes);
Reading
//fileurl is string which contain path of file
fileUrl = (Application.persistentDataPath + "/"+ markerDataObject.markerName + ".jpg");
if(System.IO.File.Exists(fileUrl))
if(www.isDone)
video.mIconPlane.renderer.material.mainTexture = imageToLoadPath.texture;
But when i read this code and show render image on texture it show me Question mark image, but when i load images from assets it works perfectly fine. Please help me that where i am doing wrong. I am nee bee in unity so thats why doing silly mistakes. This will be great for me. Thanks in advance.
Note, that unity's WWW can only dowload and save as textures JPG and PNG images. If you will try to download an image of any other format, you will get a red "?" image as result.

Get actual file name when using writeImageToSavedPhotosAlbum for iOS

I'm writing an AR app that takes a screenshot and then places the image in the photo album so that the end user can get to it. I'm using writeImageToSavedPhotosAlbum. The major issue I'm having right now is that I can't seem to get the filename of the image.
I'm getting something like the following from NSURL:
assets-library://asset/asset.PNG?id=8AD512D0-205E-424D-B466-F31CCE4F299C&ext=PNG
When I need something like:
Image_0050.png
Does anyone know how to get the actual image name? Or, maybe I'm going about this entirely wrong?
Thanks,
Nathan
There is no name. All you have is a UIImage object.
The information you need is in ALAssetRepresentation of any ALAsset. All you need to do is get default representation of current asset and then you will have access to all information you want.
ALAsset *asset = <some_asset>;
NSLog(#"filename %#", asset.defaultRepresentation.filename);

Getting image name of iphone photo library

I'm doing a project to take images from iphone photo library or in other way from camera roll. I have done that without any problem. But i need to retrieve the name from the photo library. Is there a way to do that? Any help is appreciated
Thanks
Have a look at ALAssetsLibrary which is available in iOS 4.0 and later.
Also, these links may help
How to get a photo's original filename in iOS?
iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?
If you need the full path, just use this:
ALAsset* asset; // previously assigned
NSDictionary* pathInfo = [asset valueForProperty:ALAssetPropertyURLs];
This will leave the full URL of the image on your device as the Value member of the pathInfo object.

How to obtain a copied image from the pasteboard?

I have a photo editing app where I want to provide a way for the user to edit photos from the pasteboard. For example the user might copy a photo from his website in Safari and then head over to my app and choose "Open from pasteboard". Kind of like Photoshop does it.
How can I get notified or check if there is a picture or graphic (probably a UIImage) in the pasteboard? And how could I obtain that image?
I needed one for a UIImage and this snippet helped me out.
You can always extract the image out using:
UIImage *image = [UIPasteboard generalPasteboard].image;