[wp-hackers] hacking image resizing
Sergiy Kuzmenko
s.kuzmenko at gmail.com
Tue Dec 8 04:53:34 UTC 2009
I had a bit of a problem with image resizing. Images sized stay greyed out
no matter what. GD library is enabled. In fact I tried it on two machines.
It worked fine on my Fedora desktop but failed on on the Ubuntu (hardy)
server. There is a thread in support forum about this (apparently I am not
alone) so I suspected it might be a bug. Looking at the code and trying to
find the root cause I discovered that on the machine where I have this
problem the assoc. array containing image data has no "sizes" element
required to trigger image resizing (wp-includes/media.php, function
image_get_intermediate_size).
Apparently, this assoc. array gets loaded from $wp_object_cache where it is
supposed to be initialized somehow at an earlier stage. And this is where I
get stuck. It is not very obvious which code is loading that info into
$wp_object_cache. Doing "grep -r sizes | grep -v .js" does not reveal
anything worth attention. I wonder if someone could elucidate me on how
image sizes get loaded into cache.
Many thanks.
Sergiy
More information about the wp-hackers
mailing list