~ubuntu-branches/ubuntu/karmic/libimage-exiftool-perl/karmic

« back to all changes in this revision

Viewing changes to lib/Image/ExifTool/PPM.pm

  • Committer: Bazaar Package Importer
  • Author(s): Mari Wang
  • Date: 2008-02-04 20:32:53 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080204203253-mpbal8trlfe1fz5d
Tags: 7.00-1
* Upload of new production release (Closes: #456430)
* Added Recommends: libcompress-zlib-perl (Closes: #435589)
* Package now includes iptc2xmp.args and xmp2iptc.args, they are put
  into /usr/share/libimage-exiftool/ (Closes: #436100)
* Updated standards-version (3.7.2 -> 3.7.3). No changes needed.
* Lots of updates and bugfixes compared to last debian version
  (6.90).  See the Changes file for details
* Upload sponsored by Petter Reinholdtsen

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
use vars qw($VERSION);
17
17
use Image::ExifTool qw(:DataAccess :Utils);
18
18
 
19
 
$VERSION = '1.03';
 
19
$VERSION = '1.04';
20
20
 
21
21
#------------------------------------------------------------------------------
22
22
# Read or write information in a PPM/PGM/PBM image
46
46
        return 0 unless $buff =~ /^P([1-6])\s+/g;
47
47
        $num = $1;
48
48
        # note: may contain comments starting with '#'
49
 
        if ($buff =~ /\G#/) {
 
49
        if ($buff =~ /\G#/gc) {
50
50
            # must read more if we are in the middle of a comment
51
 
            next unless $buff =~ /\G((#.*\n)*)\s*/g;
 
51
            next unless $buff =~ /\G ?(.*\n(#.*\n)*)\s*/g;
52
52
            $info{Comment} = $1;
53
 
            next if $buff =~ /\G#/;
 
53
            next if $buff =~ /\G#/gc;
54
54
        } else {
55
55
            delete $info{Comment};
56
56
        }
59
59
        $info{ImageHeight} = $2;
60
60
        $type = [qw{PPM PBM PGM}]->[$num % 3];
61
61
        last if $type eq 'PBM'; # (no MaxVal for PBM images)
62
 
        if ($buff =~ /\G\s*#/) {
63
 
            next unless $buff =~ /\G\s*((#.*\n)*)\s*/g;
 
62
        if ($buff =~ /\G\s*#/gc) {
 
63
            next unless $buff =~ /\G ?(.*\n(#.*\n)*)\s*/g;
64
64
            $info{Comment} = '' unless exists $info{Comment};
65
65
            $info{Comment} .= $1;
66
 
            next if $buff =~ /\G#/;
 
66
            next if $buff =~ /\G#/gc;
67
67
        }
68
68
        next unless $buff =~ /\G(\S+)\s/g;
69
69
        $info{MaxVal} = $1;