I'm working with images already uploaded to my server, not remote.
I'm reading that getimagesize() is very slow, but I'm not sure if that only applies to remote images:
[
php.net...]
Any suggestions on the fastest option to get the image dimensions when the image is stored locally?
I currently use:
if (is_readable($path_to . $img)) {
list($width, $height) = @getimagesize($path_to . $img);
// do stuff
}
The majority of the time, the image would be readable. If it's not then it means that there was a glitch in the server somewhere during the user's upload. Should I even test that it's readable first? Or am I wasting resources trying to prevent that 0.00001%?
Considered alternative:
if (list($width, $height) = @getimagesize($path_to . $img)) {
// do stuff
}