Error Slim Swift 2

0

I have a native iOS application, in which I must consume a web service where I send a photo in base 64 to the backend in php with slim framework but I return the following error on the code 64 of the image:

recoverable error: Corrupt JPEG data: 233 extraneous bytes before marker 0x10

This is the conversion code to base64, it will be that I have an error:

let img : NSData = UIImageJPEGRepresentation(self.imgLugar.image!, 1)!
let base64Img = img.base64EncodedStringWithOptions(.Encoding64CharacterLineLength)
    
asked by Juan David Gil 01.06.2016 в 22:23
source

1 answer

1

Remove the options by passing it to Base64 and it will probably work for you. If not, you should check the server code in case you are waiting for a different format than the one you are sending.

let base64Img = img.base64EncodedStringWithOptions([])
    
answered by 01.06.2016 в 23:13