Changes between Initial Version and Version 2 of Ticket #63707
- Timestamp:
- 07/16/2025 04:10:38 PM (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #63707
-
Property
Component
changed from
GeneraltoMedia
-
Property
Component
changed from
-
Ticket #63707 – Description
initial v2 1 Summary:1 ==== Summary: 2 2 3 When uploading a video file (e.g. .mp4) to the Media Library, WordPress may store invalid image size data in the _wp_attachment_metadatafield — for example:3 When uploading a video file (e.g. .mp4) to the Media Library, WordPress may store invalid image size data in the `_wp_attachment_metadata` field — for example: 4 4 5 5 … … 13 13 a JS freeze, empty display (no media shown) 14 14 15 Steps to reproduce:15 ==== Steps to reproduce: 16 16 17 Upload a .mp4 file via Media Library (in Grid mode). 17 - Upload a .mp4 file via Media Library (in Grid mode). 18 - Switch to List view. 19 - Make sure the uploaded video is visible. 20 - Switch back to Grid mode. 18 21 19 Switch to List view. 20 21 Make sure the uploaded video is visible. 22 23 Switch back to Grid mode. 24 25 Now WordPress will save _wp_attachment_metadata 22 Now WordPress will save `_wp_attachment_metadata` 26 23 {{{ 27 24 ['sizes'] = [ '60x60' => false ] … … 37 34 The Grid mode may hang, freeze, or fail to load media. 38 35 39 Technical notes:36 ==== Technical notes: 40 37 41 This metadata is likely generated by wp_generate_attachment_metadata()or related logic, which assumes image processing.38 This metadata is likely generated by `wp_generate_attachment_metadata()` or related logic, which assumes image processing. 42 39 43 40 The frontend JS does not expect false values in sizes, which causes unexpected behavior. … … 45 42 I'm reporting this as a WordPress user (not a developer). Please let me know if more context is needed. 46 43 47 🛠️ Temporary workaround:44 ==== 🛠️ Temporary workaround: 48 45 49 46 A filter can be used to prevent Grid mode from breaking when bogus sizes exist for video attachments: … … 72 69 Additionally, I created a simple admin tool (plugin) to preview and optionally fix video metadata records with only invalid sizes: 73 70 1. To preview video attachments with invalid `sizes`, visit: 74 /wp-admin/?preview_video_sizes=171 `/wp-admin/?preview_video_sizes=1` 75 72 2. To clean up the detected invalid `sizes`, visit: 76 /wp-admin/?fix_video_sizes=173 `/wp-admin/?fix_video_sizes=1` 77 74 78 75