drlexa
drlexa

Reputation: 197

How to disable the warning in module Image::EXIF

Good day! When you run this script:

#!/usr/bin/perl
use strict;
use warnings;

use Image::EXIF;
my $exif = new Image::EXIF($ARGV[0] || 'image3.jpg');

displayed a warning (a warning is not at all the pictures.):

(null): unknown TIFF field type; discarding (Unknown)

Is it possible to suppress this warning?

Upvotes: 0

Views: 310

Answers (1)

Miguel Prz
Miguel Prz

Reputation: 13792

Looking at the source code of that module, it has a XS native part, and the c function that is called looks like this (at file "exifutil.c"):

void exifwarn2(const char *msg1, const char *msg2)
{
    fprintf(stderr, "%s: %s (%s)\n", progname, msg1, msg2);
}

As you can see, it prints to STDERR, so you can handle STDERR properly before the call to the Image::EXIF constructor. This SO question may helps you.

Upvotes: 1

Related Questions