mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
Updated ThumbnailGenerator to work with IE
Use the polyfill for Math.log2() since IE doesn't support this method
This commit is contained in:
parent
2f0b549a81
commit
4ddc9da47b
1 changed files with 3 additions and 1 deletions
|
|
@ -105,7 +105,9 @@ module.exports = class ThumbnailGenerator extends Plugin {
|
|||
|
||||
image = this.protect(image)
|
||||
|
||||
var steps = Math.ceil(Math.log2(image.width / targetWidth))
|
||||
// Use the Polyfill for Math.log2() since IE doesn't support log2
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2#Polyfill
|
||||
var steps = Math.ceil(Math.log(image.width / targetWidth) * Math.LOG2E);
|
||||
if (steps < 1) {
|
||||
steps = 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue