photos

How to retrieve photo extension (jpg/png) in iOS 8.0 using Photos API?

百般思念 提交于 2019-12-06 04:27:56
问题 Am trying to get file extension of photos using the new Photos API in iOS 8 but haven't found a way to do so until now. Before iOS 8.0 I would use ALAssetRepresentation to get the file extension like: // Get asset representation from asset ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation]; // Extract file extension from the original file name NSString* fileExt = [[assetRepresentation filename] pathExtension]; Is there any way to get file extension of photos now? PS: I

How to get all PHAssets from MacOS's Photo Library

浪尽此生 提交于 2019-12-06 03:10:53
I want to parse all images from my MacOS Photos Library, using PHAsset . However all examples I find are only working for iOS, like the one below, where the last line, which retrieves the assets is not available on macos framework: NSMutableArray *photos = [[NSMutableArray alloc] init]; PHFetchOptions *allPhotosOptions = [[PHFetchOptions alloc] init]; allPhotosOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:YES]]; // Below compilation error as fetchAssetsWithMediaType is only on iOS framework PHFetchResult *allPhotos = [PHAsset

Saving photo with metadata into Camera Roll with specific file name

百般思念 提交于 2019-12-05 10:55:13
I'm trying to save an image with exif metadata using following code: +(void)saveImageWithMetaToCameraRoll:(UIImage*)image location:(CLLocation*)location album:(PHAssetCollection *)album exif:(NSDictionary *)metadata isOriginal:(BOOL)isOriginal isFavorite:(BOOL)isFavorite completionBlock:(PHAssetBoolBlock)completionBlock { NSMutableDictionary *meta = [metadata mutableCopy]; NSData *imageData = UIImageJPEGRepresentation(image, 1.0f); CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef) imageData, NULL); if (!isOriginal) { [meta resetOrientation]; } NSString *timestamp =

Delphi: How to tag photos the way facebook does

社会主义新天地 提交于 2019-12-05 10:38:58
问题 I need a way to tag photos in a Delphi desktop application the way Facebook does it. That includes some way to easily add the tags over the people, and then hovering the mouse over the person in the photo to show the tag. The two suggestions in the answer given to: "Delphi Components for Face Identification and Tagging" don't solve this. But I have no idea where to start, and have been unable to find ideas on the web on how to do this. How does Facebook do it? Or maybe there's a component for

Save a photo to custom album in iOS 8

淺唱寂寞╮ 提交于 2019-12-05 02:40:15
I need a little bit of help in here, I have a method that saves an UIImage to the camera roll without problems in iOS 8. The method is the following [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ [PHAssetChangeRequest creationRequestForAssetFromImage:image]; }completionHandler:^(BOOL success, NSError *error) { if(success){ NSLog(@"worked"); }else{ NSLog(@"Error: %@", error); } }]; I need to adapt that code, so that the image instead of saving the UIImage to the camera roll, it saves to a custom album named "MyAlbum" I'm using the Photos.framework Ric Santos You will first need to check

android: how to add an image to an album

ぐ巨炮叔叔 提交于 2019-12-04 17:22:24
Can anyone share code (or point me to Android sample code) to help me add images to an album in the Media Store (Gallery). In my app I download images from our server, and also take new images using the camera (via Intent). I would like to organize those images in an app-specific album, similar to what the Facebook (and other apps) app does, keeping related images all neatly organized. I looked into this a while ago, following the Media Store API docs, and it didn't work for me....so need some help. Thanks you can use: MediaStore.Images.Media.insertImage(ContentResolver cr, Bitmap source,

Is it possible to retrive an existing iPhone image's metadata (specifically geolocation data) using PhoneGap?

我是研究僧i 提交于 2019-12-04 16:48:18
I'm using PhoneGap 1.4.1 to create an iPhone application. I can successfully perform the following tasks: retrieve an image from a photo album or the camera roll take a new image with the camera retrieve the current geolocation of the device It is my understanding that images taken on the iPhone contain metadata. I believe the metadata contains the geolocation of where the picture was taken. I can't seem to find anything in the PhoneGap API about image metadata. I can already retrieve the device's current location, but I need to access the coordinates of where a picture was taken. Is it

Programatically upload pictures on Instagram workaround [closed]

孤人 提交于 2019-12-04 16:21:28
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed last year . How do services like posts.so, gramblr and picturelife post pictures on Instagram programatically? I know the Instagram API is limited and doesn't let you do this, but is there a workaround? There must be since all these services are doing it. Links to the services: https://posts.so/ http://gramblr.com/uploader/ They possibly store your Instagram password in their DB then use it to

Using AWS S3 for photo storage

匆匆过客 提交于 2019-12-04 11:47:15
问题 I'm going to be using S3 to store user uploaded photos. Obviously, I wont be serving the image files to user agents without resizing them down. However, not one size would do, as some thumbnails will be smaller than other larger previews. So, I was thinking of making a standard set of dimensions scaling from the lowest 16x16 to some highest 1024x1024. Is this a good way to solve this problem? What if I need a new size later on? How would you solve this? 回答1: Pre-generating different sizes and

How to copy an image file from iOS Photo Library (ALAssetsLibrary) to the local directory of an App?

旧城冷巷雨未停 提交于 2019-12-04 11:34:51
I can get images from Photo Library through ALAssetsLibrary: void (^assetEnumerator)(ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){ if([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypePhoto]) { // Copy the photo image to the `/Documents` directory of this App here } }; void (^assetGroupEnumerator )(ALAssetsGroup*, BOOL*) = ^(ALAssetsGroup *group, BOOL *stop){ if (group != nil) { [group enumerateAssetsUsingBlock:assetEnumerator]; } }; // fetch ALAssetsLibrary *library = [ALAssetsLibrary new]; [library enumerateGroupsWithTypes