fromFile

Creates an image source from a file.

The file is read as needed while decoding, without copying it into memory.

Return

created image source, which must be closed when no longer needed.

Parameters

file

file containing the encoded image.

Throws

if the file cannot be read or its format is not supported.