enable-media-replace
enable-media-replace copied to clipboard
Replacing image does not update metadata for asset
Using v4.0.3
When replacing an asset with a larger asset, the meta data is not updated within Wordpress. I have verified that the new asset is being uploaded and parsed, as the thumbnails are correctly regenerated, and by copying the File URL into a new tab, it does show the new asset at the larger dimensions, but the original image metadata is not updated.
This can also be seen when looking at the attachment metadata after uploading.
array (
'width' => 1280,
'height' => 700,
'file' => '2016/05/grey-felt-screen-with-circles-cut-out-suspended-in-lounge-area-scaled.jpg',
'filesize' => 727732,
'sizes' =>
array( ... ),
'image_meta' =>
array (
'aperture' => '0',
'credit' => '',
'camera' => '',
'caption' => '',
'created_timestamp' => '0',
'copyright' => '',
'focal_length' => '0',
'iso' => '0',
'shutter_speed' => '0',
'title' => '',
'orientation' => '0',
'keywords' =>
array (
),
),
'original_image' => 'grey-felt-screen-with-circles-cut-out-suspended-in-lounge-area.jpg',
)
It's still showing the original image data, not the new image data, which should be:
'width' => 3000,
'height' => 2086,
'file' => '2016/05/grey-felt-screen-with-circles-cut-out-suspended-in-lounge-area-scaled.jpg',
'filesize' => 2704020,
hello @Zxurian and thanks for reporting this issue! I ran a few tests and couldn't reproduce this issue. In other words, when doing a replace (either with Just replace the file
or Replace the file, use the new file name, and update all links
the meta data flagged in the above image gets updated correctly. I, therefore, suspect there might be something else interfering with our plugin's functionality.
Are you able to test this on a site where only our plugin is active and a standard WordPress theme, to see if you can reproduce it? If it works, then you'll probably have to take the active plugins (and the theme) one by one and deactivate them until you find the one interfering. In case you're able to still reproduce it, please send us the 2 images that you're using, as well as the options you're using when doing the replace.
I have a test site I can test with just standard WP Core & Enable Media Replace. I'll use the same image to reproduce and document steps. Currently we have two plugins that work with images, so it may be a matter of how it interacts with those plugins. Kraken Image Optimizer, & Infinity Uploads. I will perform some diagnostics with different enablements to see what series of combination / steps reproduces the issue.
hello @Zxurian, can you please check if you are still encountering the issue without other active plugins? We are preparing to release a new version this week and if a fix is required, I'd like to include it in this release. Thanks!
sorry, took a bit to have some time. So going off of a clean install. No images at all. Now using v4.1.0 of Enable Media Replace Using the following plugin list:
Advanced Custom Fields PRO
Category Order and Taxonomy Terms Order
Disable Author Archives
Disable Comments
Enable Media Replace
Genesis Blocks Pro
Media Library Assistant
Pretty Links
Query Monitor
Redirection
Relevanssi
SVG Support
WooCommerce
WP Rollback
WP-SCSS
First roadblock I ran into is when trying to just replace a media file with a new file
- https://i.imgur.com/PSvSQbC.png
- Click "Upload a new file"
- Select new file, with options of "replace the file and use new name", "replace with current date" https://i.imgur.com/qj2seiT.png
- Got the following error: https://i.imgur.com/IBjQEQF.png
Dear @Zxurian, apologies for getting back to you on this so late.
I looked over the screenshots you sent and noticed something that drew my attention. I'm talking about the slashes from this screenshot:
Something doesn't seem right in that path, using both backslashes and forwardslashes. Are you by any chance running WordPress on a Windows environment/server? While I've seen sites running (and our plugin functioning correctly with Windows-style paths), this is the first time I've seen both backslashes and forwardslashes in a path. I'm pretty sure this is the reason behind the errors you're seeing.
Closing, as we haven't got any updates here. If there are still errors, please reopen this issue.