Support » Fixing WordPress » How to updat the thumbnail name is the postmetadata table

  • Hi all,

    I run 2.5.1 on my blog and previously I use thumbnail named as myimage.thumbnail.jpg, since I upgrade to 2.5 I use myimage-125×125.jpg. I order to use the right thumb I upload to my upload folder new thumbs with the new name structure.

    I change also data in the wp-postmetadata table with this sql command :

    UPDATE wp_blog4autopostmeta SET meta_value = replace(meta_value, ‘.thumbnail’,’-125×125′)

    But when I do that I have a error on the media library :
    Warning: Invalid argument supplied for foreach() in /home/www/myfolder/wp-includes/media.php on line 264

    Any idea?

    Thanks for your help


Viewing 9 replies - 1 through 9 (of 9 total)
  • Sorry for the title, you need to read :
    How to update the thumbnail name in the postmetadata table?

    any news? thanks

    i’m having this same error. what i did to generate this error was to move the blog to a new domain. in doing so i backed up the database and did a find and replace changing all instances of the old domain with the new one. most of those were pictures. everything else about the move went fine except for this error.

    riri, have you had any luck?

    Hi nedsferatu,
    I moved my blog too and got the same problems. It only occurs with pictures.
    The two oldest of mine are fine (I think they are of wp 2.3 times) the others all show the error-message. Newly uploaded ones are fine either.

    Hints would be appreciated.

    Same problems. I have made a quick fix. May be this can be useful:
    1. Open file wp-includes/media.php
    2. Find go to line 264:
    // get the best one for a specified set of dimensions
    $imagedata = @unserialize($imagedata); //this is a quick fix

    asv2001, thanks! adding that line after the given comment got rid of the error in Manage >> Media Library. Can you give a quick comment on how/why it works? I’m always looking to learn something new about wordpress.

    great news! I will try this hack this night, thanks for the tips

    Thanks for this hint!

    WP converts arrays to strings (maybe with “serialize”) to save them in databases. And to get an array back out of these strings you can use “unserialize”. But I don’t know exactly why this fixes our problem.

    Hi can anyone help me upload pictures on my blog??i dont know how to do it can any one mail me the steps to do it my email address is

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to updat the thumbnail name is the postmetadata table’ is closed to new replies.