Image-ExifTool

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  - Exif WhiteBalance no longer overrides maker-specific WhiteBalance

Jan. 8, 2004 - Version 2.30

  - Added support for IPTC format information

Jan. 6, 2004 - Version 2.25

  - Fixed problem with ImageInfo() function prototype
  - Fixed printout of JpgFromRaw message (doesn't affect JPG extraction)
  - Set output files to binmode (including STDOUT) if -b option used (thanks
    David Anson)

Jan. 1, 2004 - Version 2.24

  - Fixed -list option to show all available tag names

Dec. 18, 2003 - Version 2.23

  - Changed "Disable" routines to "Enable"

exiftool  view on Meta::CPAN


# save our previous return codes
$rtnValPrev = $rtnVal;
$rtnValApp = $rtnVal if $rtnVal;

# exit Command loop now if we are all done processing commands
last unless @ARGV or not defined $rtnVal or $stayOpen >= 2 or @commonArgs;

# attempt to restore text mode for STDOUT if necessary
if ($binaryStdout) {
    binmode(STDOUT,':crlf') if $] >= 5.006 and $isCRLF;
    $binaryStdout = 0;
}

# flush console and print "{ready}" message if -stay_open is in effect
if ($stayOpen >= 2) {
    if ($quiet and not defined $executeID) {
        # flush output if possible
        eval { require IO::Handle } and STDERR->flush(), STDOUT->flush();
    } else {
        eval { require IO::Handle } and STDERR->flush();

html/ancient_history.html  view on Meta::CPAN


<a name='v2.30'><b>Jan. 8, 2004 - Version 2.30</b></a>
<ul>
<li>Added support for IPTC format information
</ul>

<a name='v2.25'><b>Jan. 6, 2004 - Version 2.25</b></a>
<ul>
<li>Fixed problem with ImageInfo() function prototype
<li>Fixed printout of JpgFromRaw message (doesn't affect JPG extraction)
<li>Set output files to binmode (including STDOUT) if -b option used (thanks
    David Anson)
</ul>

<a name='v2.24'><b>Jan. 1, 2004 - Version 2.24</b></a>
<ul>
<li>Fixed -list option to show all available tag names
</ul>

<a name='v2.23'><b>Dec. 18, 2003 - Version 2.23</b></a>
<ul>

lib/File/RandomAccess.pm  view on Meta::CPAN

            $self->{POS} -= $purge;
            $self->{LEN} -= $purge;
        }
    }
    return 1;
}

#------------------------------------------------------------------------------
# Set binary mode
# Inputs: 0) reference to RandomAccess object
sub BinMode($)
{
    my $self = shift;
    binmode($self->{FILE_PT}) if $self->{FILE_PT};
}

#------------------------------------------------------------------------------
# Close the file and free the buffer
# Inputs: 0) reference to RandomAccess object
sub Close($)
{
    my $self = shift;

    if ($self->{DEBUG}) {

lib/File/RandomAccess.pod  view on Meta::CPAN

=item Inputs:

0) Reference to RandomAccess object.

=item Returns:

Nothing.

=back

=item B<BinMode>

Set binary mode for file.

=over 4

=item Inputs:

0) Reference to RandomAccess object.

=item Returns:

lib/Image/ExifTool.pm  view on Meta::CPAN

                $noMagic{MXF} = 1;  # don't do magic number test on MXF or DV files
                $noMagic{DV} = 1;
            }
        } else {
            # scan through all recognized file types
            @fileTypeList = @fileTypes;
            $tiffType = 'TIFF';
        }
        push @fileTypeList, ''; # end of list marker
        # initialize the input file for seeking in binary data
        $raf->BinMode();    # set binary mode before we start reading
        my $pos = $raf->Tell(); # get file position so we can rewind
        # loop through list of file types to test
        my ($buff, $err);
        my %dirInfo = ( RAF => $raf, Base => $pos, TestBuff => \$buff );
        # read start of file for testing
        if ($raf->Read($buff, $testLen)) {
            $raf->Seek($pos, 0) or $err = 'Error seeking in file';
        } else {
            $err = $$raf{ERROR};
            $buff = '';

lib/Image/ExifTool/Import.pm  view on Meta::CPAN

    my ($buff, @tags, $found, $err, $raf, $openedFile);

    if (UNIVERSAL::isa($file, 'File::RandomAccess')) {
        $raf = $file;
        $file = 'CSV file';
    } elsif (ref $file eq 'GLOB') {
        $raf = File::RandomAccess->new($file);
        $file = 'CSV file';
    } else {
        open CSVFILE, $file or return "Error opening CSV file '${file}'";
        binmode CSVFILE;
        $openedFile = 1;
        $raf = File::RandomAccess->new(\*CSVFILE);
    }
    $delim = ',' unless defined $delim;
    # set input record separator by first newline found in the file
    # (safe because first line should contain only tag names)
    while ($raf->Read($buff, 65536)) {
        $buff =~ /(\x0d\x0a|\x0d|\x0a)/ and $/ = $1, last;
    }
    $raf->Seek(0,0);

t/GIF.t  view on Meta::CPAN

$loaded = 1;
print "ok 1\n";

my $testname = 'GIF';
my $testnum = 1;

# test 2: GIF file using data in memory
{
    ++$testnum;
    open(TESTFILE, 't/images/GIF.gif');
    binmode(TESTFILE);
    my $gifImage;
    read(TESTFILE, $gifImage, 100000);
    close(TESTFILE);
    my $info = ImageInfo(\$gifImage);
    notOK() unless check($info, $testname, $testnum);
    print "ok $testnum\n";
}

# tests 3-5: Test adding/editing/deleting various types of metadata for GIF images in memory
{
    ++$testnum;
    open(TESTFILE, 't/images/GIF.gif');
    binmode(TESTFILE);
    my $gifImage;
    read(TESTFILE, $gifImage, 100000);
    close(TESTFILE);
    my $exifTool = Image::ExifTool->new;
    $exifTool->SetNewValue(Comment => 'a new comment');
    $exifTool->SetNewValue(City => 'Kingston');
    my $image1;
    $exifTool->WriteInfo(\$gifImage, \$image1);
    $info = ImageInfo(\$image1);
    notOK() unless check($info, $testname, $testnum);

t/PNG.t  view on Meta::CPAN

    my $image;  
    my $rtnVal = $exifTool->WriteInfo('t/images/PNG.png', \$image);
    # must ignore FileSize because size is variable (depends on Zlib availability)
    my $info = $exifTool->ImageInfo(\$image, '-filesize');
    my $testfile = "t/${testname}_${testnum}_failed.png";
    if (check($exifTool, $info, $testname, $testnum)) {
        unlink $testfile;   # erase results of any bad test
    } else {
        # save the bad image
        open(TESTFILE,">$testfile");
        binmode(TESTFILE);
        print TESTFILE $image;
        close(TESTFILE);
        notOK();
    }
    print "ok $testnum\n";
}

# test 4: Test group delete, alternate languages and special characters
{
    ++$testnum;

t/TestLib.pm  view on Meta::CPAN

# Returns: 1 if files are identical
sub binaryCompare($$)
{
    my ($file1, $file2) = @_;
    my $success = 1;
    open(TESTFILE1, $file1) or return 0;
    unless (open(TESTFILE2, $file2)) {
        close(TESTFILE1);
        return 0;
    }
    binmode(TESTFILE1);
    binmode(TESTFILE2);
    my ($buf1, $buf2);
    while (read(TESTFILE1, $buf1, 65536)) {
        read(TESTFILE2, $buf2, 65536) or $success = 0, last;
        $buf1 eq $buf2 or $success = 0, last;
    }
    read(TESTFILE2, $buf2, 65536) and $success = 0;
    close(TESTFILE1);
    close(TESTFILE2);
    return $success
}

t/Writer.t  view on Meta::CPAN

    my $newtiff;
    $exifTool->SetNewValue(Headline => 'A different headline');
    $exifTool->SetNewValue(ImageDescription => 'Modified TIFF');
    $exifTool->SetNewValue(Keywords => 'another keyword', AddValue => 1);
    $exifTool->SetNewValue('xmp:SupplementalCategories' => 'new XMP info');
    writeInfo($exifTool, 't/images/ExifTool.tif', \$newtiff);
    my $info = $exifTool->ImageInfo(\$newtiff);
    unless (check($exifTool, $info, $testname, $testnum)) {
        $testfile = "t/${testname}_${testnum}_failed.tif";
        open(TESTFILE,">$testfile");
        binmode(TESTFILE);
        print TESTFILE $newtiff;
        close(TESTFILE);
        notOK();
    }
    print "ok $testnum\n";

    ++$testnum;
    my $newtiff2;
    $exifTool->SetNewValue();   # clear all the changes
    $exifTool->SetNewValue(Headline => 'headline');
    $exifTool->SetNewValue(ImageDescription => 'The picture caption');
    $exifTool->SetNewValue(Keywords => 'another keyword', DelValue => 1);
    $exifTool->SetNewValue(SupplementalCategories);
    writeInfo($exifTool, \$newtiff, \$newtiff2);
    $testfile = "t/${testname}_${testnum}_failed.tif";
    open(TESTFILE,">$testfile");
    binmode(TESTFILE);
    print TESTFILE $newtiff2;
    close(TESTFILE);
    if (binaryCompare($testfile,'t/images/ExifTool.tif')) {
        unlink $testfile;
    } else {
        notOK();
    }
    print "ok $testnum\n";
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 4.454 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-b63e86051f13 )