Possible Duplicate:
php get all the images from url which width and height >=200 more quicker
I am writing a PHP script to fetch images from URL. But I only want to display images if they are above a certain size/ or [length/width]. I tried getimagesize(), but it is very slow, especially with multiple images.
I read about using cURL. But not sure, how to get the file size or dimensions of images, when the input is a url string.
I read these and more.
http://forums.phpfreaks.com/topic/232507-faster-solution-to-check-image/
Output external image with cURL, but how do you change the width of the image?
Get image dimensions with Curl
Would appreciate help, to get image size/ dimensions.
Are you serving these images yourself ? on your server/app ?
If so, you could put the width / height information in some custom HTTP Headers in your images (you’ll need to handle the access to your image by whatever PHP solution that modify headers before outputing image.. with good cache settings).
This headers can be based on width/height calculated at upload for example and stored in database.. so it will need one and only getimagesize for ever..
After that, in curl just check the headers (without downloading the file). If the width / height match your requirement, you can then really download it.