Jump to content

better way to get image width & hieght


onenonly

Recommended Posts

getimagesize() function is too slow when loading .

all i want is image height and width but it takes so long

 

I have 5 image on my page, each is like 322 kb

it lags for like 3 secs but thats way to long for just 5 image

 

soon i will be adding thousands of image

anyways of getting image width and height faster?

Link to comment
Share on other sites

Most likely reason to the slowness is that your are dealing with remote content and when you call imagesize for a remote image php will download the image first to your server. Maybe try to use cURL instead. See this and the first comment from the comments: http://fi2.php.net/function.getimagesize . I haven't used curl so I can't really help with that.

Link to comment
Share on other sites

you could always create a new db table and write a script to store the info there when you upload them...

 

Or at least make the loading page insert the info for the images on loading, this will make sure you would never have to get the size of any image more than once..

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.