How to stop iPhone from re-compressing images while uploading to the backend?

I have a very specific requirement. I have a service that needs to load photos into their exact images. EXIF information can be ignored, but the image data itself MUST remain exactly as it is. This service also needs to work across platforms.

So far, I have tested PCs, Macs, with various browsers, and also various Android phones and they all worked as expected. When a photo is transferred from one platform to another, via emails, flash drives, various cloud services (One Drive, Google Drive, Dropbox), no problem at all. Photos remain in exact format, with the same EXIF ​​information in exact size, right down to the last byte.

But problems arise when I deal with Apple products and services. First, whenever a photo is saved to the iPhone, the iPhone seems to add some extra EXIF ​​data to the image, making the image size a little larger. But as I said above, my requirement can ignore EXIF ​​information, so I split them when they are uploaded to the server. However, the iPhone seems to do more than it downloads in the background. They seem to recompress the images before submitting them.

When I upload an image on my iPhone using Safari, it comes from the server side with an abrupt file resize. I've tested this multiple times and with different images. In some cases the size is reduced and in some cases the size is increased. This doesn't happen when I download them using my PC or Android phone. The application itself is a website, so it is written using HTML and JavaScript.

Below is an example of the results:


Image 1 - original image size: 317,185 bytes

(without removing EXIF ​​data)

Upload to server using PC or Android phone: 317,185 bytes

Upload to server using iPhone: 368 698 bytes

(remove EXIF ​​data)

Upload to server using PC or Android phone: 296,412 bytes

Upload to server using iPhone: 356,680 bytes


Image 2 - Original Image Size: 3,630 Bytes

(without removing EXIF ​​data)

Upload to server using PC or Android phone: 3,630 bytes

Upload to server using iPhone: 2,752 bytes

(remove EXIF ​​data)

Upload to server using PC or Android phone: 2,795 bytes

Upload to server using iPhone: 2,144 bytes


The only conclusion I can draw from the above is that the iPhone seems to re-compress the image prior to sending it. Why is he doing this and how to stop him?

Surely, if it was not an image, it would not embarrass him? For example .docx or .php?

+3


source to share


1 answer


This issue was fixed with the iOS 9.0.3 update. Apparently, Apple itself knew about this bug and fixed it.



+1


source







All Articles