Missing metadata for old uploaded SVG images
-
Dear Developer,
I’ve found a strange bug on one of our websites that uses your plugin to support SVG files.
We used some older versions of your Safe SVG plugin to upload SVG files to the website. I think it had a bug, the image’s metadata is not generated properly, so some required meta is missing from the SVG images.
Some plugins and themes are using this metadata for various functions, and without them, the log file is filled with undefined index notices.
I’ve tried an older version of your plugin (1.5.0 in this test) on a staging site, and I could replicate this bug! Although, it did not occur in the newer versions of the plugin.
BUT! I could not regenerate these metadata for the previously uploaded SVG pictures. How can I update these old SVG images without uploading them again?
Example old uploaded image metadata (using
wp_get_attachment_metadata()
function):Array ( [filesize] => 12313 )
Same image uploaded with the latest version on the plugin:
Array ( [width] => 1405 [height] => 256 [file] => 2022/09/televitamin-logo-wide-simple.svg [sizes] => Array ( [thumbnail] => Array ( [width] => 150 [height] => 150 [crop] => 1 [file] => televitamin-logo-wide-simple.svg [mime-type] => image/svg+xml ) [medium] => Array ( [width] => 300 [height] => 300 [crop] => [file] => televitamin-logo-wide-simple.svg [mime-type] => image/svg+xml ) [medium_large] => Array ( [width] => 768 [height] => 0 [crop] => [file] => televitamin-logo-wide-simple.svg [mime-type] => image/svg+xml ) [large] => Array ( [width] => 1024 [height] => 1024 [crop] => [file] => televitamin-logo-wide-simple.svg [mime-type] => image/svg+xml ) [1536x1536] => Array ( [width] => 1536 [height] => 1536 [crop] => 0 [file] => televitamin-logo-wide-simple.svg [mime-type] => image/svg+xml ) [2048x2048] => Array ( [width] => 2048 [height] => 2048 [crop] => 0 [file] => televitamin-logo-wide-simple.svg [mime-type] => image/svg+xml ) ) )
- The topic ‘Missing metadata for old uploaded SVG images’ is closed to new replies.