Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6197113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:45:45+00:00 2026-05-24T03:45:45+00:00

I have very little Perl experience. I need to read a binary image in

  • 0

I have very little Perl experience.

I need to read a binary image in and pass it to the Image::ExifTool module.

Here is my code:

use Image::ExifTool;

my $exifTool = new Image::ExifTool; 

open(IMAGE, $file) || die "Can't Open $file\n";
binmode(IMAGE);

my ($buf, $data, $n);
while (($n = read FILE, $data, 4) != 0) {
  $buf .= $data;
}

#'.=' is concat
print $file .= " test";

$infob = $exifTool->ImageInfo(\$buf);

foreach ( keys %$infob ) {
    print "$_ => $$infob{$_}\n";
}

close(IMAGE);

As far as I can tell, my above code reads in the reference file and appends at the byte level the binary data to $buf.

As per the ExifTool documentation, you can pass an in memory reference to a file as a scalar var to the ImageInfo method — this is done above.

When executed, the Image::ExifTool module spits out the following:

Error => Unknown file type
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:45:46+00:00Added an answer on May 24, 2026 at 3:45 am
    use Image::ExifTool;
    
    my $exifTool = new Image::ExifTool; 
    
    open( my $IMAGE, $filename ) || die "Can't Open $filename\n";
    binmode($IMAGE);
    
    $infob = $exifTool->ImageInfo($IMAGE);
    
    foreach ( keys %$infob ) {
        print "$_ => $$infob{$_}\n";
    }
    
    close($IMAGE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am moving a Perl (of which I have very little knowledge) script to
I have very little experience with MySQL/SQL in general - total n00b really! I
I have very little experience with compression algorithms; my experience just comes from running
I have very little experience with CSS. I'd like to style the default JQuery
I have very little experience in C or C++, so I don't understand some
I have few experience with languages like Python, Perl and Ruby, but I have
I have very little knowledge of pig. I have protobuf format data file. I
I'm using Python-2.6. I have very little knowledge of hash functions. I want to
Let me say ahead of time, that I have very little understanding of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.