Questions tagged [uiimagepngrepresentation]

Use this tag for questions related to UIImagePNGRepresentation.

Use this tag for questions related to UIImagePNGRepresentation. For e.g. There is something wrong while you process UIImagePNGRepresentation with your Image.

69 questions
1
vote
0 answers

Setting name of UIImage

I am building an app that allows the user to resize an uploaded image that will then present the UIActivityViewController to allow them to AirDrop or email the files to the Mac. I would like to be able to rename the exported image to contain the…
1
vote
1 answer

Importing an image using Action Extension - URL to a local Image works but not with actual image data

My iOS app (Swift 3) needs to important images from other apps using an Action Extension. I'm using the standard Action Extension template code which works just fine for apps like iOS Mail and Photos where the image shared is a URL to a local file.…
Al Linke
  • 51
  • 7
1
vote
0 answers

Save UIImage to PNG in App Bundle in Swift 3

With the new iOS 10.3 beta I heard that you can change the icon of your app programmatically using a PNG file included in your app and mentioning it in your Info.plist. I have successfully done this using images that were already in my app at…
Wilson Gramer
  • 702
  • 8
  • 23
1
vote
1 answer

From raw data to UIImagePNGRepresentation in fewer steps

Using this code, I extract an image from a Share Extension and I write it to a directory I created in an App Group. let content = self.extensionContext!.inputItems[0] as! NSExtensionItem let contentType = kUTTypeImage as String for…
user5273262
1
vote
0 answers

Unable to convert image to NSData

I get all the images from a photo library and I want to import it in the core data. I am trying to convert the images to NSData, in order to save it in the core data. Some images are converted, but others are not. I get the following…
Hamza Almass
  • 41
  • 1
  • 6
1
vote
0 answers

saving array of images with UIImagePNGRepresentation memory warning swift

I'm capturing randomly-sized/shaped sections of a UIView and saving to disk using UIImagePNGRepresentation. The files save as expected, but when I run on a device, I get the dreaded "Received memory warning", even though all I'm doing is saving…
1
vote
2 answers

Image getting bigger after saving it

I would be grateful if anyone could help me to solve an issue with image saving. I've got an app which contains recipes with corresponding images. I need to resize them in order to preserve memory and make my app more robust. Everything looks ok the…
AOY
  • 355
  • 3
  • 22
1
vote
1 answer

UIImagePNGRepresentation in monochrome

I'm developing an iPod-touch app, using Objective C. I am trying to capture a drawing the user creates on the device. I am using UIImagePNGRepresentation to capture the data in PNG format. I want to change the PNG data: specifically I need to…
brismith
  • 696
  • 3
  • 18
1
vote
0 answers

UIImagePngRepresentation sometimes cause memory leak

My code shows weird behavior, and I've searched for hours with no luck. My code snippet: func loadImageFromLocal(index:String)->UIImage{ var fileManager = NSFileManager.defaultManager() var containerURL =…
kwmaeng
  • 631
  • 2
  • 5
  • 20
1
vote
1 answer

Write UIImage to PNG; read PNG into UIImage; resulting image has twice the resolution

Following these steps I'm getting an unexpected result: 1) Write UIImage to PNG 2) Read PNG into UIImage Result: the sizes of the UIImages (before and after PNG) are different. The UIImage created by reading from the PNG has twice the resolution as…
SwiftAero
  • 69
  • 4
1
vote
2 answers

: ImageIO: CGImageReadGetBytesAtOffset in UIImagePNGRepresentation

The only other information I could find on this error was here, which wasn't helpful. I get the following error when I try to save images. This seems to only happen when I have several images (~6) at once. It also seems to be completely random as to…
cohenadair
  • 2,072
  • 1
  • 22
  • 38
1
vote
1 answer

PNG Image not saved to documents directory

I am trying to load an image from the photo library and save to the phone's document directory, however when I look in the document directory the PNG has not been created. I'm using the following code: @IBAction func saveLogo(sender: AnyObject) { …
Tom
  • 790
  • 2
  • 9
  • 32
1
vote
1 answer

Why does saving UIImages to disk increase memory usage

I am downloading cover images uploaded by App.net users. App.net requires these cover images to be at least 960 pixels wide. I fetch them with a simple AFImageRequestOperation: NSURLRequest *urlRequest = [NSURLRequest…
Shawn Throop
  • 1,281
  • 1
  • 13
  • 28
1
vote
1 answer

ABPersonSetImageData Does Not Set Contact's Full Size Image for Incoming Calls

I am able to set a new contact's thumbnail image in the iPhone address book, however, the phone does not display a full screen version when that contact calls my phone. Instead, it only displays the thumbnail version on top of the screen, with my…
JRoss
  • 177
  • 10
  • 23
1
vote
1 answer

UIImagePNGRepresentation Leaking memory

I have used below line in my code NSData *dataForImage=UIImagePNGRepresentation(image); My app crashes due low memory.When I use VM tracker/Allocation it shows me heap growth. I analyzed the code. It shows me leak on above line as 100%. Is…
user605003
  • 75
  • 1
  • 6