and it automatically converts them to JPEG. The conversion could b" /> and it automatically converts them to JPEG. The conversion could b" /> and it automatically converts them to JPEG. The conversion could b"/>

How to show spinner while Safari is converting HEIC to JPEG via <input type=file>

630 Views Asked by At

Safari allows you to select HEIC files with

<input type="file" accept="image/jpeg">

and it automatically converts them to JPEG. The conversion could be slow for multiple files on slower machines. I want to fill the waiting time between choosing the files and the firing of the the "onchange" event with a spinner.

I'm able to show a spinner when the user clicks on the input, and hide it when the "onchange" event fires. The problem is that if the user cancels the "Choose files" dialog there is no event.

2

There are 2 best solutions below

0
Yusufk On

This might be useful. It checks if something was added to the input field, i.e. a file was selected or not.

0
MartinP On

This is not needed anymore. In newer MacOS there is a spinner when choosing files from Finder.