Skip to content

Fix image MIME handling for uppercase extensions - #3429

Closed
aniruddh18122006-cyber wants to merge 1 commit into
nextcloud:masterfrom
aniruddh18122006-cyber:fix-uppercase-image-mime
Closed

aniruddh18122006-cyber wants to merge 1 commit into
nextcloud:masterfrom
aniruddh18122006-cyber:fix-uppercase-image-mime

Conversation

@aniruddh18122006-cyber

Copy link
Copy Markdown

Summary

Fixes the image format mismatch when editing images with uppercase file extensions.

Changes

  • Normalize saved image extensions to lowercase.
  • Normalize JPEG MIME types before canvas encoding.
  • Validate the encoded image blob before uploading it.
  • Add regression test cases for uppercase .JPG and .JPEG filenames.

Testing

Testing results will be updated after verification.

Fixes #3424

@skjnldsv

Copy link
Copy Markdown
Member

Hi, this looks like AI. If so, please follow our AI conduct and mention the assisted-by tag on your commits and in this pr body.
Please also fix the failing ci checks: DCO and Conventional commits by adjusting the commit title using conventional commits rules and by signing-off your commits 馃檹馃槉

@skjnldsv

Copy link
Copy Markdown
Member

Thanks a lot! master doesn't take changes any more, so I took your fix over to stable35 in #3450, with you as co-author. I kept the extension as it is, as lowercasing it saved ABC1234.JPG as a new ABC1234.jpg.

@skjnldsv skjnldsv closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Image editor silently writes PNG data into .JPG files (uppercase extension breaks canvas.toBlob MIME)

2 participants