I get the following error:
getimagesize(barbie2.jpeg) [function.getimagesize]: failed to open stream: No such file or directory
On line:
list($hight, $width) = getimagesize($name);
in getimagesize() you need to specify path of the image. Probably it is not getting image path so it is giving you error.
your file from where you have called this function and image location is different so it is giving you error.