NicolasCARPi / dropzone

Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
http://www.dropzone.dev/js
Other
71 stars 11 forks source link

Better support for HEIC files #26

Open PoeHaH opened 5 days ago

PoeHaH commented 5 days ago

First of all: thank you for maintaining this! Not sure what happened to the original Dropzone but it's widely used so I'm happy to see interest in further keeping this alive :-).

Images taken with iPhone cameras are often stored in a raw format with ".heic" extension. Their mime type is "image/heic" so Dropzone tries to render a thumbnail preview, but it doesn't work:

image

In the source code, we can see why the thumbnail can't be displayed:

image

In short, the dataUrl is not a string, but an object.

I propose to fix this by making a simple change to the thumbnail() function to check if the dataUrl is a string.

image

Would you be open to add this into the next release?

NicolasCARPi commented 4 days ago

Hello,

Would you be open to add this into the next release?

Yes, please open a PR and I'll look into it. Please add an example HEIC file in there too!

Not sure what happened to the original Dropzone

Something I see a lot in the open source world: project maintainer simply lost interest in the project and let it die the worst ay: not answering nor providing access to a new maintainer. C'est la vie !

PoeHaH commented 4 days ago

This makes me sound stupid but do you have a doc on how to open a PR? 😊

Yeah, that's part of open source!

NicolasCARPi commented 4 days ago

You can start with this document: https://github.com/NicolasCARPi/dropzone/blob/master/CONTRIBUTING.md

After if you never opened a PR on GitHub, you can read about it in their doc: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request