Add support for generating thumbnails for HEIC file uploads #1955
andrewedstrom
started this conversation in
Ideas
Replies: 4 comments
-
I’m having a similar issue. Many people take pictures with their iPhone & want to upload them. It would be great if dropzone handled that. I’ve read a few threads about conversion to base 64 strings and other work around. I would think this would be somewhat of a priority. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I ran into this myself and came up with a workaround using this library. import Dropzone from 'dropzone'
import heic2any from 'heic2any'
let dropzone = new Dropzone(/*...*/)
// Override createThumbnail function
dropzone.origCreateThumbnail = dropzone.createThumbnail
dropzone.createThumbnail = function(file, ...args) {
if (file.type === 'image/heif' || file.type === 'image/heic') {
heic2any({ blob: file, toType: 'image/jpeg' })
.then(converted => dropzone.origCreateThumbnail(converted, ...args))
.catch(() => dropzone.origCreateThumbnail(file, ...args))
} else {
dropzone.origCreateThumbnail(file, ...args)
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks.
I ended up using that same library.
… On Nov 11, 2021, at 2:56 PM, Dan Arnfield ***@***.***> wrote:
I ran into this myself and came up with a workaround using this library <https://github.com/alexcorvi/heic2any>.
import Dropzone from 'dropzone'
import heic2any from 'heic2any'
let dropzone = new Dropzone(/*...*/)
// Override createThumbnail function
dropzone.origCreateThumbnail = dropzone.createThumbnail
dropzone.createThumbnail = function(file, ...args) {
if (file.type === 'image/heif' || file.type === 'image/heic') {
heic2any({ blob: file, toType: 'image/jpeg' })
.then(converted => dropzone.origCreateThumbnail(converted, ...args))
.catch(() => dropzone.origCreateThumbnail(file, ...args))
} else {
dropzone.origCreateThumbnail(file, ...args)
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1955 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVSWXKCTLVFQAZSEUFE6DWLULRCYXANCNFSM4255OUFQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks.
I ended up using that same library.
… On Nov 11, 2021, at 2:56 PM, Dan Arnfield ***@***.*** ***@***.***>> wrote:
I ran into this myself and came up with a workaround using this library <https://github.com/alexcorvi/heic2any>.
import Dropzone from 'dropzone'
import heic2any from 'heic2any'
let dropzone = new Dropzone(/*...*/)
// Override createThumbnail function
dropzone.origCreateThumbnail = dropzone.createThumbnail
dropzone.createThumbnail = function(file, ...args) {
if (file.type === 'image/heif' || file.type === 'image/heic') {
heic2any({ blob: file, toType: 'image/jpeg' })
.then(converted => dropzone.origCreateThumbnail(converted, ...args))
.catch(() => dropzone.origCreateThumbnail(file, ...args))
} else {
dropzone.origCreateThumbnail(file, ...args)
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1955 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVSWXKCTLVFQAZSEUFE6DWLULRCYXANCNFSM4255OUFQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We rely on Dropzone's automatic thumbnail creation for standard image types like
jpg
andpng
.However, many of our users are on iPhones and thus upload images with the
heic
filetype. It would be super helpful if Dropzone could automatically generate thumbnails for those images as well!In the meantime, we're still figuring out the best workaround we can use to deal with
heic
images. We will likely try to convert them tojpg
images on the client-side. We also have considered generating thumbnails server-side but that would be even messier. None of these options seem that great.Beta Was this translation helpful? Give feedback.
All reactions