mangarevolution Posted May 4, 2005 Posted May 4, 2005 I'm wondering if I run this: $hash = getimagesize("http://www.someotherserver_notmine.com/image.jpg"); does it count against my bandwidth? does the getimagesize command require the executing server to actually fetch the image from the hosting server? or does it simply fetch header information for that image? I use this a lot in my code, so it would be a great help to get some insights. Thanks guys! Quote
TweezerMan Posted May 4, 2005 Posted May 4, 2005 I'm wondering if I run this:$hash = getimagesize("http://www.someotherserver_notmine.com/image.jpg"); does the getimagesize command require the executing server to actually fetch the image from the hosting server? or does it simply fetch header information for that image? <{POST_SNAPBACK}> The getimagesize() PHP function retrieves the entire image when called on an image URL. does it count against my bandwidth? <{POST_SNAPBACK}> Yes, it does. Quote
mangarevolution Posted May 4, 2005 Author Posted May 4, 2005 I'm wondering if I run this:$hash = getimagesize("http://www.someotherserver_notmine.com/image.jpg"); does the getimagesize command require the executing server to actually fetch the image from the hosting server? or does it simply fetch header information for that image? <{POST_SNAPBACK}> The getimagesize() PHP function retrieves the entire image when called on an image URL. does it count against my bandwidth? <{POST_SNAPBACK}> Yes, it does. <{POST_SNAPBACK}> I was afraid of that. thanks for the insights, I couldn't find that answer anywhere. Quote
TweezerMan Posted May 4, 2005 Posted May 4, 2005 No problem - I coudn't find an answer that was recent enough to be relied on, but it mentioned a method to prove what getimagesize() does easily: Write a simple script that uses getimagesize() on a large image. After running the script, the full image retrieval by getimagesize() will be shown in the Apache access log. Quote
borfast Posted May 5, 2005 Posted May 5, 2005 I think you can call getimagesize() with a simple filesystem path and it will simply get the image directly from the filesystem instead of generating an HTTP request for it and spending some bandwidth Quote
TweezerMan Posted May 5, 2005 Posted May 5, 2005 I think you can call getimagesize() with a simple filesystem path and it will simply get the image directly from the filesystem instead of generating an HTTP request for it and spending some bandwidth <{POST_SNAPBACK}> That's correct, but the image does have to be stored on the local server in order to do so. Quote
borfast Posted May 6, 2005 Posted May 6, 2005 $hash = getimagesize("http://www.someotherserver_notmine.com/image.jpg"); You're right, David. Sorry, I should have read mangarevolution's post more carefully. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.