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

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.