_wp_attachment_metadata filename

  • Unknown's avatar

    How can I change one of the filenames in the _wp_attachment_metadata entry in the database? When I change a filename, it no longer works with the image. (It shows white space instead of the image).

    Scenario: I am trying to upload an image manually via FTP. I then create the attachment record in wp_posts. The issue seems to arise with wp_postmeta table for _wp_attachment_metadata. Creating this entry manually doesn’t work, and when referencing an existing images it only works if the filenames remain unaltered. This is the entry:

    a:6:{s:5:”width”;i:1200;s:6:”height”;i:1200;s:4:”file”;s:19:”2023/10/unnamed.jpg”;s:8:”filesize”;i:435183;s:5:”sizes”;a:12:{s:6:”medium”;a:5:{s:4:”file”;s:19:”unnamed-300×300.jpg”;s:5:”width”;i:300;s:6:”height”;i:300;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:36852;}s:5:”large”;a:5:{s:4:”file”;s:21:”unnamed-1024×1024.jpg”;s:5:”width”;i:1024;s:6:”height”;i:1024;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:316825;}s:9:”thumbnail”;a:5:{s:4:”file”;s:19:”unnamed-200×200.jpg”;s:5:”width”;i:200;s:6:”height”;i:200;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:16877;}s:12:”medium_large”;a:5:{s:4:”file”;s:19:”unnamed-768×768.jpg”;s:5:”width”;i:768;s:6:”height”;i:768;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:199126;}s:11:”thumb-small”;a:5:{s:4:”file”;s:17:”unnamed-50×50.jpg”;s:5:”width”;i:50;s:6:”height”;i:50;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:1733;}s:12:”thumb-medium”;a:5:{s:4:”file”;s:19:”unnamed-300×135.jpg”;s:5:”width”;i:300;s:6:”height”;i:135;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:18196;}s:14:”thumb-featured”;a:5:{s:4:”file”;s:19:”unnamed-250×175.jpg”;s:5:”width”;i:250;s:6:”height”;i:175;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:20076;}s:16:”wpsso-schema-4×3″;a:5:{s:4:”file”;s:28:”unnamed-1200×900-cropped.jpg”;s:5:”width”;i:1200;s:6:”height”;i:900;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:0;}s:17:”wpsso-schema-16×9″;a:5:{s:4:”file”;s:28:”unnamed-1200×675-cropped.jpg”;s:5:”width”;i:1200;s:6:”height”;i:675;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:0;}s:15:”wpsso-thumbnail”;a:5:{s:4:”file”;s:28:”unnamed-1200×628-cropped.jpg”;s:5:”width”;i:1200;s:6:”height”;i:628;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:0;}s:15:”wpsso-opengraph”;a:5:{s:4:”file”;s:28:”unnamed-1200×628-cropped.jpg”;s:5:”width”;i:1200;s:6:”height”;i:628;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:0;}s:15:”wpsso-tc-lrgimg”;a:5:{s:4:”file”;s:28:”unnamed-1200×628-cropped.jpg”;s:5:”width”;i:1200;s:6:”height”;i:628;s:9:”mime-type”;s:10:”image/jpeg”;s:8:”filesize”;i:0;}}s:10:”image_meta”;a:12:{s:8:”aperture”;s:1:”0″;s:6:”credit”;s:0:””;s:6:”camera”;s:0:””;s:7:”caption”;s:0:””;s:17:”created_timestamp”;s:1:”0″;s:9:”copyright”;s:0:””;s:12:”focal_length”;s:1:”0″;s:3:”iso”;s:1:”0″;s:13:”shutter_speed”;s:1:”0″;s:5:”title”;s:0:””;s:11:”orientation”;s:1:”0″;s:8:”keywords”;a:0:{}}}

  • The topic ‘_wp_attachment_metadata filename’ is closed to new replies.