Last change
on this file since 13983 was 13983, checked in by lh92, 17 years ago |
Added for Realistic Book Project
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
871 bytes
|
Line | |
---|
1 | # NOTE: Derived from lib/Image/Size.pm.
|
---|
2 | # Changes made here will be lost when autosplit is run again.
|
---|
3 | # See AutoSplit.pm.
|
---|
4 | package Image::Size;
|
---|
5 |
|
---|
6 | #line 825 "lib/Image/Size.pm (autosplit into blib/lib/auto/Image/Size/xpmsize.al)"
|
---|
7 | # Added by Randy J. Ray, 30 Jul 1996
|
---|
8 | # Size an XPM file by looking for the "X Y N W" line, where X and Y are
|
---|
9 | # dimensions, N is the total number of colors defined, and W is the width of
|
---|
10 | # a color in the ASCII representation, in characters. We only care about X & Y.
|
---|
11 | sub xpmsize
|
---|
12 | {
|
---|
13 | my $stream = shift;
|
---|
14 |
|
---|
15 | my $line;
|
---|
16 | my ($x, $y, $id) = (undef, undef, "Could not determine XPM size");
|
---|
17 |
|
---|
18 | while ($line = &$read_in($stream, 1024))
|
---|
19 | {
|
---|
20 | next unless ($line =~ /"\s*(\d+)\s+(\d+)(\s+\d+\s+\d+){1,2}\s*"/s);
|
---|
21 | ($x, $y) = ($1, $2);
|
---|
22 | $id = 'XPM';
|
---|
23 | last;
|
---|
24 | }
|
---|
25 |
|
---|
26 | ($x, $y, $id);
|
---|
27 | }
|
---|
28 |
|
---|
29 | # end of Image::Size::xpmsize
|
---|
30 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.