-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Labels
[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is brokenAn existing feature is broken
Milestone
Description
Bug Description
This may be a misconfiguration issue, but at the moment if a file is uploaded with the same filename but the extension is jpeg or jpg, the corresponding webp file generated is overwritten by the last file uploaded.
Steps to reproduce
- Create 2 files, for example,
Paul-Test.jpeg
andPaul-Test.jpg
- Go to Media Gallery
- Click on Add New
- Upload
Paul-Test.jpeg
- Check
~/wp-content/uploads/2022/06/Paul-Test.jpeg
- Check
~/wp-content/uploads/2022/06/Paul-Test.webp
- Upload
Paul-Test.jpg
- Check
~/wp-content/uploads/2022/06/Paul-Test.jpg
- Check
~/wp-content/uploads/2022/06/Paul-Test.webp
- The file
Paul-Test.webp
created fromPaul-Test.jpeg
is overwritten with the webp generated fromPaul-Test.jpg
Additional Context
I have added this to functions.php:
/* Image conversion attributes */
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return [
'image/jpeg' => [ 'image/jpeg', 'image/webp' ],
'image/png' => [ 'image/png', 'image/webp' ],
'image/webp' => [ 'image/webp', 'image/jpeg' ],
];
});
- PHP Version: 7.4
- OS: RHEL 8.6
- Browser: Firefox
- Plugin Version: 1.1.0
To note, PNGs with the same filename do not overwrite the webp image (an image is not created at all).
Metadata
Metadata
Assignees
Labels
[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)Issues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is brokenAn existing feature is broken