Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Aug 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 }),
Comment on lines +57 to +60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks goofy but it works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree, do you have a suggestion?

data: compressedBlob,
})
this.uppy.setFileMeta(file.id, { type })
Expand Down