/    Sign up×
Community /Pin to ProfileBookmark

quick image filesize and dimensions

hi,
what is the quickest way to access a images size? at the moment i am using this:

[code=php]
echo strlen(@file_get_contents($_GET[‘file’]));
[/code]

and i am also using this to grab the image dimensions:

[code=php]
list($width,$height)=@getimagesize($_GET[‘file’]);
[/code]

the problem is that (using javascript) it loops through about a few thousand images and this takes a lot of time per image and for the whole lot, is there a quicker method?

cheers

EDIT: Note that the images are not located on the domain same domain

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsDec 10.2004 — to get the file size "quickly":[code=php]<?php
echo filesize($_GET['file']);
?>[/code]
the problem is that (using javascript) it loops through about a few thousand images and this takes a lot of time per image and for the whole lot, is there a quicker method?[/QUOTE]why??? sounds excessive to me
Copy linkTweet thisAlerts:
@artemisauthorDec 10.2004 — Actually i found that using javascript is a lot quicker - it took about 30 mins to do 500 images using php but with javacript took 8 mins.

Also filesize() doesnt seem to work when the images are not on your server.

Thanks.
×

Success!

Help @artemis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...