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
0
votes
1 answer

error handling in Swift 2

i have to fix the follow code for swift2. if !UIImagePNGRepresentation(img).writeToFile(imagePath, options: nil, error: &error) { if let actualError = error { NSLog("Image not saved.…
Paolo Gdf
  • 759
  • 3
  • 10
  • 15
0
votes
2 answers

Retrieving saved image using swift

I am trying to retrieve an image saved using: let pngData = UIImagePNGRepresentation(image) let finalPath = filePath() // This method just create the path to save to. saveImage(pngData, filePath: finalPath) Later I want to retrieve this data and…
pls
  • 1,522
  • 2
  • 21
  • 41
0
votes
1 answer

Why does comparison with UIImagePNGRepresentation not work?

I have a button which should represent a Checkbox. When the button is clicked, the imageView.image-Property is set to another UIImage. So, I have two variables for the checked and unchecked image. UIImage *checkedImage = [UIImage…
0
votes
1 answer

UIImagePNGRepresentation save a portrait image in landscape orientation

After I get an image from iPhone gallery using imagePickerController I want to save that image in the app document directory, so I use this code: -(void)saveImage:(UIImage*)image{ NSString *imagePath = [NSHomeDirectory() …
0
votes
2 answers

UIImagePickerController show correct image until I save the image

I am getting a UIImage with UIImagePickerController. After getting the image, I set it as the background of a UITableView. The image looks exactly as I took it. But then if I save the image to my server and then load the image back. Whether I save…
0
votes
1 answer

How to display .RGB on uiimageview

I am having file with extension .RGB and need to display it on uiimageview. For this i need to convert the .RGB format to specific format like .PNG or .JPEG however unable to get it right . I tried with following code for this. UIImage…
user968597
  • 1,164
  • 2
  • 15
  • 30
-1
votes
1 answer

pngData() file save is lossy or lossless

We are saving image as png file in swift as below pngData().write(fileURL,atomic) The file saved is lossy or lossless ? I checked for any tools online but did not find answers.
Banng
  • 531
  • 1
  • 6
  • 19
-1
votes
1 answer

take uiimageview image and convert to uiimage (swift4)

I have a image view with a photo in it. I want to take that photo and convert it it to a UIImagePNGRepresentation. In a effort to store it as core Data. What I have coded right now does no work. import UIKit class editVCViewController:…
user8105388
-1
votes
2 answers

Getting an error when converting UIImage to NSSString via NSData

I'm trying to convert my UIImage from a UIImageView to a string as the data is stored as Base64. I'm using the method below to convert the image but it falls over when trying to update convertedStr. func convertImg() { let imageData: NSData =…
user616076
  • 3,907
  • 8
  • 38
  • 64
1 2 3 4
5