Alamofire encodes the image in what format?

I use alamofire to send an image to the server with multipart.

multipartFormData.append(UIImageJPEGRepresentation(self.imageDet[0].image!,0.5)!, withName: "filestream", mimeType: "image/jpeg") 

I have an image in byte format on the server side.

Here is an example of the bytes I get from the server side

      JFIFHH  XExifMM* i&       8Photoshop 3.08BIM8BIM%  ู      B~    "      }!1AQa"q2   #B  R  $3br  %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz                                                                               w!1AQaq"2 B     #3R br  $4 % &'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz                                                                          C 

How to convert the following data back to image?

+1
swift jpeg encode alamofire uiimagejpegrepresentation
source share
1 answer

Images are encoded in JPEG and converted to binary ( Data or NSData ) when writing UIImageJPEGRepresentation(...) . Then this binary data is sent to the server.

0
source share

All Articles