1Image::Info::XPM(3) User Contributed Perl Documentation Image::Info::XPM(3)
2
3
4
6 Image::Info::XPM - XPM support for Image::Info
7
9 use Image::Info qw(image_info dim);
10
11 my $info = image_info("image.xpm");
12 if (my $error = $info->{error}) {
13 die "Can't parse image info: $error\n";
14 }
15 my $color = $info->{color_type};
16
17 my($w, $h) = dim($info);
18
20 This modules supplies the standard key names except for Compression,
21 Gamma, Interlace, LastModificationTime, as well as:
22
23 ColorPalette
24 Reference to an array of all colors used. This key is only present
25 if "image_info" is invoked as "image_info({ColorPalette>=1})".
26
27 ColorTableSize
28 The number of colors the image uses.
29
30 HotSpotX
31 The x-coord of the image's hotspot. Set to -1 if there is no
32 hotspot.
33
34 HotSpotY
35 The y-coord of the image's hotspot. Set to -1 if there is no
36 hotspot.
37
38 L1D_Histogram
39 Reference to an array representing a one dimensioanl luminance
40 histogram. This key is only present if "image_info" is invoked as
41 "image_info($file, L1D_Histogram=>1)". The range is from 0 to 255,
42 however auto-vivification is used so a null field is also 0, and
43 the array may not actually contain 255 fields.
44
45 XPM_CharactersPerPixel
46 This is typically 1 or 2. See Image::Xpm.
47
48 XPM_Extension-.*
49 XPM Extensions (the most common is XPMEXT) if present.
50
52 process_file()
53 $info->process_file($source, $options);
54
55 Processes one file and sets the found info fields in the $info object.
56
59 This module requires Image::Xpm
60
61 $Image::Info::XPM::RGBLIB is set to /usr/share/X11/rgb.txt by default,
62 this is used to resolve textual color names to their RGB counterparts.
63
65 Image::Info, Image::Xpm
66
68 For more information about XPM see:
69
70 ftp://ftp.x.org/contrib/libraries/xpm-README.html
71
73 While the module attempts to be as robust as possible, it may not
74 recognize older XBMs (Versions 1-3), if this is the case try inserting
75 /* XPM */ as the first line.
76
78 Jerrad Pierce <belg4mit@mit.edu>/<webmaster@pthbb.org>
79
80 Now maintained by Tels - (c) 2006.
81
82 This library is free software; you can redistribute it and/or modify it
83 under the same terms as Perl itself.
84
85
86
87perl v5.12.0 2010-05-02 Image::Info::XPM(3)