transloadit / uppy

The next open source file uploader for web browsers :dog:
https://uppy.io
MIT License
29.18k stars 2.01k forks source link

Extremely slow image selection on IOS devices #5062

Open shalev123d opened 7 months ago

shalev123d commented 7 months ago

Initial checklist

Link to runnable example

No response

Steps to reproduce

Hello, Tested on multiple iOS devices + multiple Uppy configurations as well on the example page - https://uppy.io/examples/ The issue is when selecting around 50+ images, and then clicking "Add", there is a delay of around 10-20 seconds depends on the device, while all android phones tested works just fine immediately.

Steps to reproduce -

  1. Enter https://uppy.io/examples/
  2. on an iOS device, click "My Files", select 50+ images from the gallery (local files)
  3. Click "Add"
  4. Notice the huge delay until the photos appear on the Dashboard UI.

Expected behavior

Photos should be added immediately after clicking "Add"

Actual behavior

Huge delay, around 10-20 seconds and even more on older iPhones.

Murderlon commented 7 months ago

Hi, I don't think there is anything we can do here. To access files you use a browser API, we don't implement that API ourselves. Over time I've seen quite some iOS specific bugs that were resolved over time.

We could double check with other file plugin libraries to see if it's faster or the same.

shalev123d commented 7 months ago

@Murderlon Thanks for the reply! I see what you're saying and that makes sense. Although I tried as a test to upload the same files to Google Drive and it was immediate in the same iOS devices. If it's possible to double check it'd be awesome, thanks a lot in advance

Murderlon commented 7 months ago

Just tested this on https://pqina.nl/filepond/ and it happens there too for me on iOS Safari.

verschaevesiebe commented 4 months ago

A good test here was going to the desktop google drive website on mobile in different browsers and they all seem to have the same behaviour (indeed loading a lot of images takes ages ...).

Not sure how to fix this as i'm building my own little app, guess adding a label "please don't select too much" haha. Keep me posted if anyone finds a decent solution.

Murderlon commented 4 months ago

I'm fairly certain this is a OS or browser level bug. I don't have ideas how to solve this.

kevinisyoung commented 3 days ago

Thanks for starting this thread--this bug is unfortunately detrimental to the web app I'm creating. Gigantic bummer!!! It would be huge for this to be fixed. After testing on an Android device there was near zero delay for selecting a ton of images. I wonder if there's anyone we could reach out to someone at Apple about this.

kevinisyoung commented 2 days ago

For anyone coming to this thread later -- I'm pretty sure I've realized the slow handoff from the Photo Library selector is due to converting/re-exporting of the images. If the images on the iPhone are stored using the HEIC format (which they are by default) then the file selector has to convert each image (or even video, if in .MOV), into jpg or something more "safe". It sucks that it takes so long, but honestly I just have to accept defeat on this one. I can't argue that the behavior makes perfect sense. Oh well! @verschaevesiebe @Murderlon @shalev123d

Murderlon commented 2 days ago

Are you sure that's the case? Because Safari on macOS and iOS is the only browser that does support HEIC.

kevinisyoung commented 2 days ago

Supports as in... can properly display HEIC files? I'm not sure we are on the same page--the topic of this thread relates more to the uploading of those photos in native iOS Safari Photo selector, and not the displaying of them.

The whole reason why it takes a long time to add photos from an iOS devices photo library to a web input element is because the images are converted from HEIC to a more widely supported format. I don't know what format. Maybe jpeg. Actually the link you provided helps illustrate this--since HEIC is an Apple-only thing, Apple intentionally programmed the sharing of photos from the photo library to first export the image to a different, more widely supported format. It converts the images one by one from HEIC to something else before moving forward, and that's what's taking so long.

Does that make sense?