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

« back to all changes in this revision

Viewing changes to lib/Image/ExifTool/IPTC.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:
14
14
use strict;
15
15
use vars qw($VERSION $AUTOLOAD %iptcCharset);
16
16
 
17
 
$VERSION = '1.22';
 
17
$VERSION = '1.23';
18
18
 
19
19
%iptcCharset = (
20
20
    "\x1b%G"  => 'UTF8',
939
939
        $exifTool->{DIR_COUNT}->{IPTC} = $dirCount;
940
940
        $exifTool->{SET_GROUP1} = '+' . $dirCount if $dirCount > 1;
941
941
    }
 
942
    # quick check for improperly byte-swapped IPTC
 
943
    if ($dirLen >= 4 and substr($$dataPt, $pos, 1) ne "\x1c" and
 
944
                         substr($$dataPt, $pos + 3, 1) eq "\x1c")
 
945
    {
 
946
        $exifTool->Warn('IPTC data was improperly byte-swapped');
 
947
        my $newData = pack('N*', unpack('V*', substr($$dataPt, $pos, $dirLen) . "\0\0\0"));
 
948
        $dataPt = \$newData;
 
949
        $pos = 0;
 
950
        $dirEnd = $pos + $dirLen;
 
951
        # NOTE: MUST NOT access $dirInfo DataPt, DirStart or DataLen after this!
 
952
    }
942
953
    while ($pos + 5 <= $dirEnd) {
943
954
        my $buff = substr($$dataPt, $pos, 5);
944
955
        my ($id, $rec, $tag, $len) = unpack("CCCn", $buff);