Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uppy/thumbnail-generator

Package Overview
Dependencies
Maintainers
6
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppy/thumbnail-generator - npm Package Compare versions

Comparing version 2.0.0-alpha.0 to 2.0.0

14

lib/index.js

@@ -9,4 +9,2 @@ "use strict";

const Translator = require('@uppy/utils/lib/Translator');
const dataURItoBlob = require('@uppy/utils/lib/dataURItoBlob');

@@ -81,3 +79,3 @@

return new Promise((resolve, reject) => {
return new Promise(resolve => {
if (this.queueProcessing) {

@@ -145,3 +143,3 @@ this.uppy.once('thumbnail:all-generated', () => {

});
const orientationPromise = exifr.rotation(file.data).catch(_err => 1);
const orientationPromise = exifr.rotation(file.data).catch(() => 1);
return Promise.all([onload, orientationPromise]).then(([image, orientation]) => {

@@ -243,4 +241,4 @@ const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.deg);

let sW = targetWidth * Math.pow(2, steps - 1);
let sH = targetHeight * Math.pow(2, steps - 1);
let sW = targetWidth * 2 ** (steps - 1);
let sH = targetHeight * 2 ** (steps - 1);
const x = 2;

@@ -353,3 +351,3 @@

return this.requestThumbnail(current).catch(err => {}) // eslint-disable-line handle-callback-err
return this.requestThumbnail(current).catch(() => {}) // eslint-disable-line node/handle-callback-err
.then(() => this.processQueue());

@@ -411,2 +409,2 @@ }

}, _class.VERSION = "2.0.0-alpha.0", _temp);
}, _class.VERSION = "2.0.0", _temp);
{
"name": "@uppy/thumbnail-generator",
"description": "Uppy plugin that generates small previews of images to show on your upload UI.",
"version": "2.0.0-alpha.0",
"version": "2.0.0",
"license": "MIT",

@@ -25,3 +25,3 @@ "main": "lib/index.js",

"dependencies": {
"@uppy/utils": "^4.0.0-alpha.0",
"@uppy/utils": "^4.0.0",
"exifr": "^6.0.0"

@@ -35,3 +35,3 @@ },

},
"gitHead": "113b627dd0ef5aa5d198dc309dda05da2117dfe5"
"gitHead": "ab771cbe1cd87affd87c97bc983b19058e2e72bd"
}
const { UIPlugin } = require('@uppy/core')
const Translator = require('@uppy/utils/lib/Translator')
const dataURItoBlob = require('@uppy/utils/lib/dataURItoBlob')

@@ -69,3 +68,3 @@ const isObjectURL = require('@uppy/utils/lib/isObjectURL')

const orientationPromise = exifr.rotation(file.data).catch(_err => 1)
const orientationPromise = exifr.rotation(file.data).catch(() => 1)

@@ -164,4 +163,4 @@ return Promise.all([onload, orientationPromise])

}
let sW = targetWidth * Math.pow(2, steps - 1)
let sH = targetHeight * Math.pow(2, steps - 1)
let sW = targetWidth * 2 ** (steps - 1)
let sH = targetHeight * 2 ** (steps - 1)
const x = 2

@@ -265,3 +264,3 @@

return this.requestThumbnail(current)
.catch(err => {}) // eslint-disable-line handle-callback-err
.catch(() => {}) // eslint-disable-line node/handle-callback-err
.then(() => this.processQueue())

@@ -353,3 +352,3 @@ }

return new Promise((resolve, reject) => {
return new Promise((resolve) => {
if (this.queueProcessing) {

@@ -356,0 +355,0 @@ this.uppy.once('thumbnail:all-generated', () => {

@@ -1,2 +0,2 @@

import type { PluginOptions, UIPlugin } from '@uppy/core'
import type { PluginOptions, UIPlugin, UppyFile } from '@uppy/core'

@@ -14,4 +14,14 @@ import ThumbnailGeneratorLocale from './generatedLocale'

declare class ThumbnailGenerator extends UIPlugin<ThumbnailGeneratorOptions> {}
declare class ThumbnailGenerator extends UIPlugin<ThumbnailGeneratorOptions> { }
export default ThumbnailGenerator
// Events
export type ThumbnailGeneratedCallback<TMeta> = (file: UppyFile<TMeta>, preview: string) => void;
declare module '@uppy/core' {
export interface UppyEventMap<TMeta> {
'thumbnail:generated' : ThumbnailGeneratedCallback<TMeta>
}
}

@@ -18,2 +18,9 @@ import Uppy from '@uppy/core'

})
uppy.on('thumbnail:generated', (file, preview) => {
const img = document.createElement('img')
img.src = preview
img.width = 100
document.body.appendChild(img)
})
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc