3

I have a Perl script:

#!/usr/bin/perl

use strict;

use Image::Magick;

my $temp_filename = 'temp.webp';

my $im = Image::Magick->new;
my $m = $im->Read($temp_filename);

When I run it from the command line, I get:

$ perl test.cgi
Decoded /tmp/magick-324583Dvjs7UCnJGp. Dimensions: 450 x 300. Now saving...
Saved file /tmp/magick-324589ZiUphKo482g
$

I expect (and want):

$ perl test.cgi
$

What gives?

Bintz
  • 784
  • 2
  • 9
  • 22
  • Is that the actual script that produces that output? The file name is different for starters, and the code doesn't do any writing of the image... – Shawn May 04 '22 at 22:06
  • Cannot reproduce with the script provided, even if I add a `$im->write('foo.jpg');`. Works fine on my system, without any output. Please provide a minimal *working* script that demonstrates the problem, and give us some information about your system (OS, Perl version, ImageMagick library version, Image::Magick version). – type_outcast May 04 '22 at 22:29
  • This is the EXACT script I am using to get this output, including the filename in the code, and the filenames in the output. OS is CentOS 7, Perl 5.16.3, ImageMagick 6.9.10-68 Q16, Image::Magick version 6.9.10 – Bintz May 05 '22 at 01:35

1 Answers1

4

Adding

$im->SetAttribute(quiet=>1);

fixed this issue for me.

Final script:

#!/usr/bin/perl

use strict;

use Image::Magick;

my $temp_filename = 'temp.webp';

my $im = Image::Magick->new;
$im->SetAttribute(quiet=>1);
my $m = $im->Read($temp_filename);
Bintz
  • 784
  • 2
  • 9
  • 22