If I take a picture with my iPhone in portrait mode, and send this picture with alamofire to server -> the image will stored perfectly. If I try to use this picture in html, the orientation is wrong. The image is rotated -90 degrees. I tried to save the image in jpg, and png format, but I have the same issue both.
Alamofire.upload(
multipartFormData: { multipartFormData in
multipartFormData.append(imageData, withName: "image", fileName: "image.png", mimeType: "image/png")
},
to: SERVER_URL,
encodingCompletion: { encodingResult in
switch encodingResult {.....
On the server side:
<?php
.....
$response['error'] = "NULL";
$filename = uniqid() . ".png";
move_uploaded_file($_FILES['image']['tmp_name'], "image/" . $filename) ......
?>
I think there will be 2 different solution, but I could not find the correct way. 1) I have to change the orientation on my iPhone device somehow 2) I have to change the orientation on the server side before I upload to the server.
(I don't want to make the solution on the client side)