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

Compressor plugin resets metadata name #3762

Closed
mellow-fellow opened this issue May 20, 2022 · 3 comments · Fixed by #3890
Closed

Compressor plugin resets metadata name #3762

mellow-fellow opened this issue May 20, 2022 · 3 comments · Fixed by #3890
Assignees
Labels

Comments

@mellow-fellow
Copy link
Contributor

When the file name of an image is updated the compressor plugin resets it to the original name before being uploaded.

I had a quick look and it may be because of line 63 here:

const { name, type, size } = compressedBlob
const { extension } = getFileNameAndExtension(name)
this.uppy.setFileState(file.id, {
name,
extension,
type,
size,
data: compressedBlob,
})
this.uppy.setFileMeta(file.id, { name, type })
compressedFiles.push(file)

@Murderlon
Copy link
Member

@arturi is probably most knowledgeable here

@mellow-fellow
Copy link
Contributor Author

mellow-fellow commented Jul 4, 2022

@arturi This error can be replicated on the Uppy examples page.

  1. Have the "Compress images" option selected
  2. Select a file and update the metadata name
  3. Upload the file and the name changes back to the original name

If you skip the first step by deselecting the "Compress images" option, the metadata name is not changed back.

By the looks of it, removing line 63 from the above snippet should fix the issue. However I haven't looked deep enough into it to see if it will have any other unintended side effects.

@Murderlon
Copy link
Member

@arturi can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants