Forum Moderators: coopster
As you may know, the AWS does not return dimensions with the image url.
I tried using getimagesize on the remote URL, it would literally take over a minute per image.
I used a script at from O'Reilly's hackbook (#477) to cache the .jpg locally and then getimagesize it. Here it is:
$asin = "0788815709";
$url = [images.amazon.com...]
$filedata = "";
$remoteimage = fopen($url, 'rb');
if ($remoteimage) {
while(!feof($remoteimage)) {
$filedata.= fread($remoteimage,1024);
}
}
fclose($remoteimage);
$localimage = fopen("/tmp/".$asin.".jpg", 'wb');
fwrite($localimage,$filedata);
fclose($localimage);
$size=getimagesize($localimage);
Again, it would take FOREVER.
Even tried Pear's remote_image. FOREVER!
I'm able to get all the XML info for hundreds of DVDs in seconds...any clue why it's taking forever to deal with the images?