input type="file" automatically compresses images in iphone

problem


When I tried to upload image with input tag in iphone, it automatically compresses image. 10MB image was compressed to 657KB in iphone. It did not happen in ipad or android

reproduction

Code

Code Block html
<input type="file" accept="image/*" onchange="loadFile(event)">
 
<script>
var loadFile = function(event) {
  const imageFile = event.target.files[0];
  alert(Math.round(imageFile.size/1000) + 'KB');
};
</script>

Result Image

Code Block
https://user-images.githubusercontent.com/40619551/98071491-078d3b00-1ea7-11eb-82d0-7a4e9307904f.gif

env

IPhone 8
IOS 14.1


bug generating environment

Upload from iPhone

It is normally uploaded on iPads.

Select from Photo Library

If you select a picture as a browser, it will be uploaded normally.

Not connected to the icloud

If you connect to the icloud, it will be uploaded normally.

above a certain capacity

No conversion occurs at lower capacity. However, the criteria for conversion seems to vary from file format to file format.

In the case of jpeg, the conversion occurred if it exceeded 10MB, but in the case of png, the conversion occurred only when it exceeded 20MB.



input type="file" automatically compresses images in iphone
 
 
Q