Skip to content

Commit

Permalink
Fix Compressor being broken when no name is in the compressed blob (#…
Browse files Browse the repository at this point in the history
…3947)

* Fix Compressor being broken when no name is in the compressed blob

* Update packages/@uppy/compressor/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
arturi and aduh95 committed Aug 4, 2022
1 parent 8f72280 commit 0d482cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/@uppy/compressor/src/index.js
Expand Up @@ -52,12 +52,12 @@ export default class Compressor extends BasePlugin {
this.uppy.log(`[Image Compressor] Image ${file.id} compressed by ${prettierBytes(compressedSavingsSize)}`)
totalCompressedSize += compressedSavingsSize
const { name, type, size } = compressedBlob
const { extension } = getFileNameAndExtension(name)
const extension = name && getFileNameAndExtension(name).extension
this.uppy.setFileState(file.id, {
name,
extension,
type,
size,
...(name && { name }),
...(extension && { extension }),
...(type && { type }),
...(size && { size }),
data: compressedBlob,
})
this.uppy.setFileMeta(file.id, { type })
Expand Down

0 comments on commit 0d482cc

Please sign in to comment.