@uppy/compressor
Advanced tools
Comparing version 0.2.4 to 0.2.5
# @uppy/compressor | ||
## 0.2.5 | ||
Released: 2022-04-27 | ||
Included in: Uppy v2.9.4 | ||
- @uppy/compressor: Set meta on file compression (Camilo Forero / #3644) | ||
## 0.2.4 | ||
@@ -4,0 +11,0 @@ |
@@ -66,3 +66,5 @@ "use strict"; | ||
const { | ||
name | ||
name, | ||
type, | ||
size | ||
} = compressedBlob; | ||
@@ -75,6 +77,10 @@ const { | ||
extension, | ||
type: compressedBlob.type, | ||
data: compressedBlob, | ||
size: compressedBlob.size | ||
type, | ||
size, | ||
data: compressedBlob | ||
}); | ||
this.uppy.setFileMeta(file.id, { | ||
name, | ||
type | ||
}); | ||
} catch (err) { | ||
@@ -81,0 +87,0 @@ this.uppy.log(`[Image Compressor] Failed to compress ${file.id}:`, 'warning'); |
{ | ||
"name": "@uppy/compressor", | ||
"description": "Uppy plugin that compresses images before upload, saving up to 60% in size", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "main": "lib/index.js", | ||
"@transloadit/prettier-bytes": "^0.0.9", | ||
"@uppy/utils": "^4.0.6", | ||
"@uppy/utils": "^4.0.7", | ||
"compressorjs": "^1.1.1", | ||
@@ -34,3 +34,3 @@ "preact": "^10.5.13", | ||
"peerDependencies": { | ||
"@uppy/core": "^2.1.7" | ||
"@uppy/core": "^2.1.9" | ||
}, | ||
@@ -37,0 +37,0 @@ "publishConfig": { |
@@ -53,3 +53,3 @@ import { BasePlugin } from '@uppy/core' | ||
totalCompressedSize += compressedSavingsSize | ||
const { name } = compressedBlob | ||
const { name, type, size } = compressedBlob | ||
const { extension } = getFileNameAndExtension(name) | ||
@@ -59,6 +59,7 @@ this.uppy.setFileState(file.id, { | ||
extension, | ||
type: compressedBlob.type, | ||
type, | ||
size, | ||
data: compressedBlob, | ||
size: compressedBlob.size, | ||
}) | ||
this.uppy.setFileMeta(file.id, { name, type }) | ||
} catch (err) { | ||
@@ -65,0 +66,0 @@ this.uppy.log(`[Image Compressor] Failed to compress ${file.id}:`, 'warning') |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22000
255
Updated@uppy/utils@^4.0.7