source: trunk/gsdl/perllib/cpan/auto/Image/Size/mngsize.al@ 13983

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: 902 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.
4package Image::Size;
5
6#line 872 "lib/Image/Size.pm (autosplit into blib/lib/auto/Image/Size/mngsize.al)"
7# mngsize: gets the width and height (in pixels) of an MNG file.
8# See <URL:http://www.libpng.org/pub/mng/spec/> for the specification.
9#
10# Basically a copy of pngsize.
11sub mngsize
12{
13 my $stream = shift;
14
15 my ($x, $y, $id) = (undef, undef, "could not determine MNG size");
16 my ($offset, $length);
17
18 # Offset to first Chunk Type code = 8-byte ident + 4-byte chunk length + 1
19 $offset = 12; $length = 4;
20 if (&$read_in($stream, $length, $offset) eq 'MHDR')
21 {
22 # MHDR = Image Header
23 $length = 8;
24 ($x, $y) = unpack("NN", &$read_in($stream, $length));
25 $id = 'MNG';
26 }
27
28 ($x, $y, $id);
29}
30
31# end of Image::Size::mngsize
321;
Note: See TracBrowser for help on using the repository browser.