Pike v8.1 release 6

Method Image.Dims.get()


Method get

array(int|string) get(string|Stdio.File file)

Description

Read dimensions from a JPEG, GIF, PNG, WebP, TIFF or PSD file and return an array with width and height, or if the file isn't a valid image, 0. The argument file should be file object or the data from a file. The offset pointer will be assumed to be at the start of the file data and will be modified by the function.

Returns
Array
int 0

Image width.

int 1

Image height.

string 2

Image type. Any of "gif", "png", "tiff", "jpeg", "webp" and "psd".