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($file, 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 dimensional 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
58 This module requires Image::Xpm
59
60 $Image::Info::XPM::RGBLIB is set to /usr/X11R6/lib/X11/rgb.txt or an
61 equivalent path (see the "_get_rgb_txt" function for the complete list)
62 by default, this is used to resolve textual color names to their RGB
63 counterparts.
64
66 Image::Info, Image::Xpm
67
69 For more information about XPM see
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 XPMs (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 Tels - (c) 2006.
81
82 Now maintained by Slaven Rezic <srezic@cpan.org>.
83
84 This library is free software; you can redistribute it and/or modify it
85 under the same terms as Perl itself.
86
87
88
89perl v5.32.1 2021-01-27 Image::Info::XPM(3)