Questions tagged [uiimagejpegrepresentation]

For questions related to the UIImageJPEGRepresentation method for the UIImage class on the iOS platform, a method commonly used to convert images to JPEG.

91 questions
1
vote
1 answer

XCode Message from debugger: Terminated due to memory issue when I use UIImageJPEGRepresentation

var data = UIImageJPEGRepresentation(image, 0.8) I am using XCode 8.0 / Swift 3 I sometimes receive a "Message from debugger: Terminated due to memory issue" error when i use an image from the UIImagePickerController I tried to make the…
1
vote
0 answers

how to convert jpg to tiff inside my app

I have not been able to find any info on creating a TIFF on iOS (or converting a jpg or getting a TIFF representation from a UIImage) in the search engines. I need to create a TIFF image, preferably from my UIImage or converting from a jpg…
samad5353
  • 381
  • 1
  • 5
  • 18
1
vote
1 answer

Compress image with UIImageJPEGRepresentation before sending to server

I'm trying to compress an image before uploading to the server using UIImageJPEGRepresentation. So far, I've changed the image to PNG and changed the quality to 0.01f. I've tried a few different ways of writing this. Is this optimal before sending…
Paul
  • 1,179
  • 3
  • 14
  • 38
1
vote
1 answer

How to improve sharpness when resizing UIImage?

In my app I need to upload photos on server, so before that, I want to resize and compress them to acceptable size. I tried to resize them in two ways, and the first way is: // image is an instance of original UIImage that I want to resize …
Marko
  • 2,021
  • 4
  • 16
  • 18
1
vote
1 answer

imageWithData image size become bigger?

I create a UIimage using the imageWithData method: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *chosenImage = [info…
nice
  • 79
  • 1
  • 1
  • 7
1
vote
1 answer

image creating slow down servre

I have function and with this funqction I`m trying to create some images in my server foreach($value[0] as $imagekey => $imageval) { $imgname = $gancxadeba . '_' . $imagekey; $saveaddr =…
shalvasoft
  • 89
  • 1
  • 9
1
vote
1 answer

UIImageJPEGRepresentation creates a white bottom bar

I am using UIImageJPEGRepresentation after I capture an image with AVCaptureSession and AVCaptureStillImageOutput. For some reason when I compress my images with UIImageJPEGRepresentation the image has a thin white line at the bottom of the picture.…
Blane Townsend
  • 2,888
  • 5
  • 41
  • 55
1
vote
1 answer

Possible memory issue on UIImageJPEGRepresentation

I have a method that saves a bunch of UIImages as JPGs and my app is crashing, I believe due to memory not being released. I'm using UIImageJPEGRepresentation to save the images, and I'm wrapping it in an autorelease pool but it doesn't seem to be…
0
votes
1 answer

Objective C - image upload optimize file size

I'm able to upload an image using ASIHTTPRequest. Code is something like this. - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSData *imageData =…
teepusink
  • 27,444
  • 37
  • 107
  • 147
0
votes
1 answer

UIImageJPEGRepresentation generates JPEG without SOI Marker

I'm generating JPEG image data using UIImageJPEGRepresentation(UIImage, 1.0) in Swift version 4(?). I'm using a 3rd party JPEG decoder but it throws an error that no SOI (start of image) marker was found. How do I generate a correctly formatted JPEG…
pinglock
  • 982
  • 2
  • 12
  • 30
0
votes
1 answer

Random line when resizing image via function?

After a user picks a image, it gets saved to their phone and stored like this: // When a user selects a image - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary…
iosfreak
  • 5,228
  • 11
  • 59
  • 102
0
votes
1 answer

UIImageJPEGRepresentation not working in iOS 13.2.3

I am using the following code to convert UIImage to NSData: imgData = UIImageJPEGRepresentation(image, 0.75); The code is working fine with iOS 12.4, but when I try with it with iOS 13.2.3, it returns nothing. Any help would be greatly…
Cemil Tatoglu
  • 65
  • 1
  • 10
0
votes
3 answers

error loop for UIImageJPEGRepresentation Swift

I'm saving an image to disk from received push notification.At first I tried to use the static function that I normally use throughout my app, but I couldn't reference it from NotificationService.swift which is the notification extension. So I…
Vincenzo
  • 5,304
  • 5
  • 38
  • 96
0
votes
0 answers

Swift base 64 string DIRECTLY to Jpeg on filesystem

I am getting base64 images in an API call and I need to store these as files locally. I was trying to write this data without having to convert the string to UIImage and then UIImage to JPEGRepresentation. I don't want the overhead of creating…
user2363025
  • 6,365
  • 19
  • 48
  • 89
0
votes
2 answers

Why doesnt UIImage(data:) create an image at the compressed file size?

I am trying to shrink the size of an image using the code below after converting the UIImage to a compressed JPEG representation and back to a UIImage the UIImage file is still to large how can I shrink the file size of the UIImage? func…