Name

Label( ) — add a label to an image

Synopsis

$image->Label(string)

Add a label to an image. Optionally, you can include any of the following bits of information about the image in the string by embedding the appropriate special characters:

%b

for the image file size in bytes

%d

for the directory in which the image resides

%e

for the extension of the image file

%f

for the filename of the image

%h

for the image height

%m

for the image file format

%s

for the scene number of the image

%t

for the filename of the image file without the extension

%w

for the image width

For example:

$image->Label("%m:%f %wx%h"' );

creates a label for the image with the stringbeatniks:GIF 318x265 if $image is a 318 × 265 image that was read from a file titled beatniks.gif.

Get Programming Web Graphics with Perl and GNU Softwar now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.