ret, table = IsPicture(file$[, table])
file$ is in a supported
picture format. If it is, this function will return True, otherwise
False. If this function returns True, you can load the picture by calling
LoadBGPic() or LoadBrush().
New in Hollywood 4.5: This function returns a table now as the second return value. If the specified file is an image, the table will contain some information about the image file. The following fields of the return table will be initialized:
Width:
Height:
Depth:
Alpha:True if image has an alpha channel, False otherwise.
Vector:True if image is in a scalable vector format, False otherwise. (V5.0)
Transparency:True if image has a monochrome transparency channel, i.e. a transparent pen
in a palette-based image. (V6.0)
Format:
#IMGFMT_BMP:
#IMGFMT_PNG:
#IMGFMT_JPEG:
#IMGFMT_ILBM:
#IMGFMT_GIF:
#IMGFMT_TIFF:
#IMGFMT_NATIVE:#IMGFMT_NATIVE as the result.
#IMGFMT_PLUGIN:(V8.0)
This function is much faster than LoadBrush() or LoadBGPic() because it
will not load the picture. It will just check its format header and
return whether or not Hollywood can handle it. However, please note that
image plugins you have installed might not be as optimized as Hollywood's
inbuilt image loader and so they can slow down IsPicture() significantly
because by default IsPicture() will first ask all plugins if they can load
the picture and then Hollywood's inbuilt image loader will be asked. Thus,
you might want to disable plugins for IsPicture() by setting the Loader
tag (see below) to Inbuilt. This means that IsPicture() will never ask any
plugins if they can load the picture. Only Hollywood's very optimized inbuilt
image loader will be asked in that case.
Starting with Hollywood 6.0 this function accepts an optional table argument which allows you to configure further options:
Loader:Inbuilt for the best
performance, but then only formats supported by Hollywood's inbuilt image loader
will be recognized (see above for details). Defaults to the loader set using SetDefaultLoader().
See Loaders and adapters for details. (V6.0)
Adapter:
UserTags:See LoadBrush for a list of supported image formats.
Note that when using Miniwood this command requires imageio library.
True if the picture is in a supported format, False otherwiseTrue (V4.5)