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:
1.0 KB
|
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 950 "lib/Image/Size.pm (autosplit into blib/lib/auto/Image/Size/ppmsize.al)"
|
---|
7 | # ppmsize: gets data on the PPM/PGM/PBM family.
|
---|
8 | #
|
---|
9 | # Contributed by Carsten Dominik <[email protected]>
|
---|
10 | sub ppmsize
|
---|
11 | {
|
---|
12 | my $stream = shift;
|
---|
13 |
|
---|
14 | my ($x, $y, $id) = (undef, undef,
|
---|
15 | "Unable to determine size of PPM/PGM/PBM data");
|
---|
16 | my $n;
|
---|
17 |
|
---|
18 | my $header = &$read_in($stream, 1024);
|
---|
19 |
|
---|
20 | # PPM file of some sort
|
---|
21 | $header =~ s/^\#.*//mg;
|
---|
22 | ($n, $x, $y) = ($header =~ /^(P[1-6])\s+(\d+)\s+(\d+)/s);
|
---|
23 | $id = "PBM" if $n eq "P1" || $n eq "P4";
|
---|
24 | $id = "PGM" if $n eq "P2" || $n eq "P5";
|
---|
25 | $id = "PPM" if $n eq "P3" || $n eq "P6";
|
---|
26 | if ($n eq 'P7')
|
---|
27 | {
|
---|
28 | # John Bradley's XV thumbnail pics (thanks to [email protected])
|
---|
29 | $id = 'XV';
|
---|
30 | ($x, $y) = ($header =~ /IMGINFO:(\d+)x(\d+)/s);
|
---|
31 | }
|
---|
32 |
|
---|
33 | ($x, $y, $id);
|
---|
34 | }
|
---|
35 |
|
---|
36 | # end of Image::Size::ppmsize
|
---|
37 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.