uiimagejpegrepresentation

From the results of UIImagePickerControlleHow, how do I get JPEG with metadata included in it?

我的未来我决定 提交于 2020-01-22 06:00:26
问题 On iOS 4.2 when I use UIImagePickerController to let the user select a image from the photo library these are the dictionary keys that are returned to me: 2011-03-02 13:15:59.518 xxx[15098:307] didFinishPickingMediaWithInfo: info dictionary: { UIImagePickerControllerMediaType = "public.image"; UIImagePickerControllerOriginalImage = "<UIImage: 0x3405d0>"; UIImagePickerControllerReferenceURL = "assets-library://asset/asset.JPG?id=1000000050&ext=JPG"; } Using one or more of these keys, how can I

how to upload UIImage on server?

一世执手 提交于 2019-12-24 09:49:17
问题 I am new to iphone, Is it possible to upload uiimage on server without using any php or other files. I got may examples of uploading image by sending request to some php file. But i don't wants to use php files. I have server path and Upload folder on server. Can Anyone has solution to upload image on server with only using iphone ?? Any Idea is greatly appreciated. 回答1: Where are you uploading a photo to? There needs to be a server side script to receive the file, typically a PHP, Perl, or

What should compressionQuality be when using UIImageJPEGRepresentation?

偶尔善良 提交于 2019-12-20 11:24:05
问题 I would like to apply a filter to a photo from the user's library then write it back to disk. I'm using UIImageJPEGRepresentation . This function takes a UIImage and a compressionQuality value between 0.0 and 1.0. Because I want to preserve the original quality, I set it to 1.0. But I found this actually creates an image file that's larger in file size than the original, somewhat significantly larger even. I noticed in Apple's Sample Photo Editing Extension app they always set the quality to

PNG/JPEG representation from CIImage always returns nil

坚强是说给别人听的谎言 提交于 2019-12-17 04:07:55
问题 I'm currently making a photo editing app. When a photo is selected by the user, it is automatically converted into black and white using this code: func blackWhiteImage(image: UIImage) -> Data { print("Starting black & white") let orgImg = CIImage(image: image) let bnwImg = orgImg?.applyingFilter("CIColorControls", withInputParameters: [kCIInputSaturationKey:0.0]) let outputImage = UIImage(ciImage: bnwImg!) print("Black & white complete") return UIImagePNGRepresentation(outputImage)! } The

UIImageJpgRepresentation doubles image resolution

拈花ヽ惹草 提交于 2019-12-11 08:08:31
问题 I am trying to save an image coming from the iPhone camera to a file. I use the following code: try UIImageJPEGRepresentation(toWrite, 0.8)?.write(to: tempURL, options: NSData.WritingOptions.atomicWrite) This results in a file double the resolution of the toWrite UIImage. I confirmed in the watch expressions that creating a new UIImage from UIImageJPEGRepresentation doubles its resolution -> toWrite.size CGSize (width = 3264, height = 2448) -> UIImage(data: UIImageJPEGRepresentation(toWrite,

Take snapshot / screenshot of whole UIView - iPhone

女生的网名这么多〃 提交于 2019-12-11 01:04:58
问题 I am trying to take a screenshot/snapshot of a UIView. I am able to get the a screenshot with the code below of the current visible view - but i am after the whole view. The view is a scrollview so there is content below that isnt visible that i would like to be included How do i extend this code to take into account the view that isnt visible? UIGraphicsBeginImageContext(activityView.frame.size); [self.activityView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *fullScreenshot

Can't convert NSData to NSString when using UIImageJPEGRepresentation()?

主宰稳场 提交于 2019-12-10 00:45:48
问题 I am creating a multipart image data upload request. i am getting NSData from UIImage by UIImageJPEGRepresentation but when i try to convert the data into string i am getting nil value i have followed this link to convert NSData to NSString Convert UTF-8 encoded NSData to NSString here is my code :- NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; [request addValue:contentType forHTTPHeaderField:@"Content-Type"]; NSMutableString *body =

iOS 4 Image Oriented Incorrectly When Posted To Server

北慕城南 提交于 2019-12-08 09:58:44
问题 I am a relatively new iOS developer. I am attempting to build an app that uploads images to a server. However, when I get the image with metadata, the orientation is always off. Here is the code I am using: - (void)getJPEGFromAssetForURL:(NSURL *)url { ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init]; [assetslibrary assetForURL:url resultBlock: ^(ALAsset *myasset) { self.rep = [myasset defaultRepresentation]; NSLog(@"getJPEGFromAssetForURL: default asset representation for %@:

UIImagePickerController and the need to save the UIImage asap vs. exploiting the file backing

99封情书 提交于 2019-12-07 20:05:05
问题 I've read uiimagepickercontroller uiimage memory and more and other relevant questions, but I can't get my head around one thing, and I wonder if there are people around here with experience on this particular aspect. In my app I let the user select an image from his library, ultimately resulting in an upload. (An interesting thing here, is that the images in there may originate from 12-megapixel high quality camera's, since e.g. iTunes happily syncs them into the phone.) For various reasons,

Given a CIImage, what is the fastest way to write image data to disk?

强颜欢笑 提交于 2019-12-07 06:58:13
问题 I'm working with PhotoKit and have implemented filters users can apply to photos in their Photo Library. I am currently obtaining the image, applying a filter, returning the edited version as a CIImage , then I convert the CIImage into NSData using UIImageJPEGRepresentation so I may write that out to disk. While this works beautifully, when users attempt to edit really large (like 30 MB) photos it can take upwards of 30 seconds for this to occur, with 98% of the time spent on