photolibrary

Get file size of PHAsset without loading in the resource?

做~自己de王妃 提交于 2020-02-18 19:57:29
问题 Is there a way to get the file size on disk of a PHAsset without doing requestImageDataForAsset or converting it to ALAsset ? I am loading in previews of a user's photo library - potentially many thousands of them - and it's imperative to my app that they know the size before import. 回答1: You can grab the fileSize of a PHAsset and convert it to human readable form like this: let resources = PHAssetResource.assetResources(for: yourAsset) // your PHAsset var sizeOnDisk: Int64? = 0 if let

Get file size of PHAsset without loading in the resource?

放肆的年华 提交于 2020-02-18 19:57:11
问题 Is there a way to get the file size on disk of a PHAsset without doing requestImageDataForAsset or converting it to ALAsset ? I am loading in previews of a user's photo library - potentially many thousands of them - and it's imperative to my app that they know the size before import. 回答1: You can grab the fileSize of a PHAsset and convert it to human readable form like this: let resources = PHAssetResource.assetResources(for: yourAsset) // your PHAsset var sizeOnDisk: Int64? = 0 if let

Using PhoneGap, How to get base64 image data of the photo chosen from photo library in iPhone

房东的猫 提交于 2020-01-11 05:06:20
问题 Using PhoneGap(Cordova), Am trying to get base64 image data of the photo chosen from the photo library. I could do that.. when the photo is captured from camera, With the below snippet of code in Cordova. navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.DATA_URL }); function onSuccess(imageData) { var image = document.getElementById('myImage'); image.src = "data:image/jpeg;base64," + imageData; } function onFail(message) { alert('Failed

Save image in UIImageView to iPad Photos Library

自作多情 提交于 2020-01-10 14:25:59
问题 I am creating an iPad app that has several pictures ( UIImageViews ) in a horizontal scrollview. I want to allow the user to be able to save the images to their Photo Library when they tap on one of the UIImageView s. I like the way Safari handles this matter: you just tap and hold until a pop up menu appears and then click save image. I know there is the " UIImageWriteToSavedPhotosAlbum ". But I am a newbie to iOS development and I'm not too sure where to go with it and where to put it (i.e.

Error occuring when loading photolibrary images : ERROR: FigCreateCGImageFromJPEG returned -12910. 423114 bytes. We will fall back to software decode

╄→гoц情女王★ 提交于 2020-01-04 05:53:11
问题 I'm working with an application in which I'm loading images from photolibrary. I'm using the following code for binding the image to imageView. -(void)loadImage:(UIImageView *)imgView FileName:(NSString *)fileName { typedef void (^ALAssetsLibraryAssetForURLResultBlock)(ALAsset *asset); typedef void (^ALAssetsLibraryAccessFailureBlock)(NSError *error); ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) { ALAssetRepresentation *rep = [myasset defaultRepresentation];

how to get total count of photos from iphone photoLibrary.?

江枫思渺然 提交于 2019-12-25 05:04:30
问题 i want to get the count of photos in photoLibrary. Currently, i'am able to get the photoes from photoLibrary and add to myApp's Document directry ONE BY ONE. But what i want is, save all the photos from photoLibrary to Document directry of myApp ALL AT ONCE. Thats why i need the count of photoes in photoLibrary. I've used UIImagePickerControllerSourceTypePhotoLibrary to retrieve the photoes from iPhone photoLibrary. Any help would be appreaciated.. thanks in advance.... 回答1: Use

Ionic-3 Photo-library plugin crashes in iOS version 13. Unexpectedly found nil while unwrapping an Optional value: file

ぃ、小莉子 提交于 2019-12-24 15:31:39
问题 Ionic-3 Photo-library plugin crashes in iOS version 13. Works fine in iOS 12 version. Here is the log: 2019-09-30 12:03:03.878478+0530 destinate[453:135517] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 “(null)”" Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Volumes/Data/Projects/Destinate/destinate/platforms/ios/destinate/Plugins/cordova-plugin-photo-library/PhotoLibraryService.swift, line 314 2019-09-30 12:03:04.117471+0530

Cordova Camera Plugin in IOS 9

大城市里の小女人 提交于 2019-12-24 13:03:16
问题 I am using Cordova 5.3.3 and the Apache Camera Plugin 1.2.0 on IOS 9. I can succesfully take a picture with the camera however when I try to get a picture from photo library it goes back to camera and I get an error "has no access to assets" in the cordova error callback. I am using the following code. navigator.camera.getPicture(onSuccess, onFail, { quality: 75, destinationType: Camera.DestinationType.DATA_URL, sourceType : Camera.PictureSourceType.PHOTOLIBRARY }); When I check the the

iphone, when saving image with “renderInContext” to device, the image is blurry?

梦想的初衷 提交于 2019-12-23 07:56:10
问题 I'm using this code to render an image from view. Then i am saving it to photo album. The image is blurry? Why? Is there a solution? UIGraphicsBeginImageContext(self.view.bounds.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); Tnx all. 回答1: You are propably using a retina device, Change the following UIGraphicsBeginImageContext(self.view.bounds.size) to

Email jpg created in app including metadata

你。 提交于 2019-12-18 14:02:48
问题 I have successfully added metadata to a jpg created within the app and saved it to the Camera Roll using the writeImageToSavedPhotosAlbum: metadata: completionBlock: method. However I would also like the option of emailing this jpg with the metadata (such as location, exit, etc.). I use this to email: MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSData *myData = UIImageJPEGRepresentation(emailImage, 0.8); [picker