This function does not require the
GD image library.
Included in this section for being in common use.
This function returns, directly, the size of any supported given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondent HTTP content type.
Additionally can also return some more information in
$image_info parameter passed as reference.
This function expects
$filename to be a valid image file.
If a non-image file is supplied, it may be incorrectly detected as an image and the function will return successfully, but the array may contain nonsensical values.
You should not use this function to check that a given file is a valid image; there are other functions to do this.
Some image files like JPC and JP2 are capable of having components with different bit depths.
In this case, the value for
bits is the highest bit depth encountered.
Also, JP2 files may contain multiple JPEG 2000 codestreams.
In this case, this function returns the values for the first codestream it encounters in the root of the file.
The information about icons are retrieved from the icon with the highest bitrate.
In the GIF images with one or more frames, where each frame may only occupy part of the image; the size reported by this function is the overal size, that is readed by the logical screen descriptor.
$filename can reference a local file or, (configuration permitting), a remote file using one of the supported stream wrappers:
STREAM WRAPPERS |
MEANING |
file:// |
LOCAL File System |
http:// |
URL HTTP |
ftp:// |
URL FTP |
php:// |
I/O streams |
zlib:// |
Data Compression stream |
data:// |
DATA (RFC-2397) |
glob:// |
Find Filenames |
phar:// |
PHP Archive |
ssh2:// |
Secure Shell 2 |
rar:// |
RAR |
ogg:// |
Audio |
expect:// |
Interaction of stream processes |
ed48 |
$image_info is the optional parameter that allows to extract some extended information from the image file.
There are other functions which display such information in more detail, if available, in JPEG files.