pqina / filepond-plugin-image-preview

🖼 Show a preview for images dropped on FilePond
https://pqina.nl/filepond
MIT License
46 stars 26 forks source link

SVGs without width and height show "uploading" indefinitely in Firefox/IE 11 #44

Closed srt4rulez closed 3 years ago

srt4rulez commented 3 years ago

Describe the bug

If an SVG has no width and height attributes, filepond shows "uploading" indefinitely. Once you do this, the filepond instance cannot upload any other files.

Logs

None.

To Reproduce

https://codesandbox.io/s/vanilla-filepond-forked-4gizr

  1. Download the codesandbox zip

  2. Upload the "carrot.svg" from the static folder.

  3. The SVG renders correctly, and then successfully "uploads".

  4. Upload the "carrot_no_width_height.svg"

  5. Filepond shows "Uploading" indefinitely.

  6. Cancel the upload.

  7. Attempt to upload the original "carrot.svg" again.

  8. The SVG renders correctly, but Filepond shows "Uploading" indefinitely again.

Expected behavior

I expect that if an SVG has no width or height, there is no image preview, but it still uploads correctly, and allows me to upload files after cancelling.

Stacktraces

None.

Information about your project:

Additional context

After writing out this template, I found it this only happens in Firefox and IE 11. Chrome 87.0.4280.66 (64-bit) and Microsoft Edge Version 87.0.664.47 (64-bit) showed a preview of the SVG and uploaded it successfully.

Also, this only happens with the image preview plugin. If you remove it, the SVG uploads successfully.

srt4rulez commented 3 years ago

@rikschennink Any ideas here? I'd like to help out if possible 😁

rikschennink commented 3 years ago

Very much appreciated.

I think this Firefox bug report is related: https://bugzilla.mozilla.org/show_bug.cgi?id=1328124