Jump to content

getimagesize() extremely slow with remote images...


Fender963

Recommended Posts

I am having some troubles with getimagesize() and remote images.  It works, but very very slowly.  Time taken for a local image isn't noticeable.  Time taken for a remote image can be anywhere from 1-2 minutes.  I know it's not the remote server because doing a simple <img src="http://www.remote.com/image.jpg"> takes neglible time. 

 

From what I've read this doesn't seem to be an uncommon problem but I'm having trouble finding a solution.

 

Anyone have a workaround for this?

 

PHP 4.4.4

 

Thanks for the help!

- Kyle

Link to comment
Share on other sites

I just ran some tests with getimagesize(), fopen, and with cURL and here are the results for a remote image:

 

CURL Script timer: 28.818582 seconds.

 

FOPEN Script timer: 23.664872 seconds.

 

getimagesize Script timer: 24.743154 seconds.

 

I then tried it with a local image and here are the results:

 

CURL Script timer: 0.000729 seconds.

 

FOPEN Script timer: 0.000127 seconds.

 

getimagesize Script timer: 0.000164 seconds.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.