[SOLVED] PerlMagick Get() attributes: only partially working in v7.0.8 [reinstalled]

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Locked
E. Fudd Wabbitwy
Posts: 27
Joined: 2019-09-18T08:46:14-07:00
Authentication code: 1152

[SOLVED] PerlMagick Get() attributes: only partially working in v7.0.8 [reinstalled]

Post by E. Fudd Wabbitwy »

After the install-from-source exercise, I notice that some of the calls to Get('attribute') return empty.

Here's the simple code:

Code: Select all

#!/usr/bin/perl

use Image::Magick;

my $imagesrc = Image::Magick->new;
open(IMAGE, 'Source.png');
$imagesrc->Read(file=>\*IMAGE);
close(IMAGE);

my $depth=$imagesrc->Get('depth'); 
print "Depth: $depth\n";
my $version=$imagesrc->Get('version'); 
print "Version: $version\n";
my $width=$imagesrc->Get('width'); 
print "Width: $width\n";
my $height=$imagesrc->Get('height'); 
print "Height: $height\n";
my $geometry=$imagesrc->Get('geometry'); 
print "Geometry: $geometry\n";
my $magick=$imagesrc->Get('magick'); 
print "magick: $magick\n";
with only 'depth' and 'version' returning real values:
Depth: 16
Version: ImageMagick 7.0.8-65 Q16 x86_64 2019-09-19 https://imagemagick.org
Width:
Height:
Geometry:
magick:

The fact that at least a couple are right suggest that it's more likely to be a case of calling with the wrong names or format rather than that the install was defective. Again, I'd like to look at what attributes are actually named in the module itself, as-installed, on my machine, but how to do that is still a mystery to me.
Last edited by E. Fudd Wabbitwy on 2019-09-20T11:47:37-07:00, edited 1 time in total.

E. Fudd Wabbitwy
Posts: 27
Joined: 2019-09-18T08:46:14-07:00
Authentication code: 1152

Re: PerlMagick Get() attributes: only partially working in v7.0.8

Post by E. Fudd Wabbitwy »

It may be that the new install doesn't understand PNG files the way the old version, installed from the ubuntu distribution, did:

% magick identify -verbose Source.png
identify: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/560.
stall doesn't understand PNG files the way the old pkg-manager-installed version did.

However it seems unlikely because JPG doesn't fare any better:
$ magick identify -verbose Target.jpg
identify: no decode delegate for this image format `JPG' @ error/constitute.c/ReadImage/560.

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: PerlMagick Get() attributes: only partially working in v7.0.8

Post by magick »

We're getting expected results with 7.0.8-65:

Code: Select all

Depth: 8
Version: ImageMagick 7.0.8-66 Q16 x86_64 2019-09-18 https://imagemagick.org
Width: 70
Height: 46
Geometry: 
magick: PNG
Type `magick -list configure` and see if your release of ImageMagick includes support for JPEG and PNG. We get:

Code: Select all

DELEGATES             bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms ltdl lzma openexr pangocairo png raqm raw tiff webp wmf x xml zlib

E. Fudd Wabbitwy
Posts: 27
Joined: 2019-09-18T08:46:14-07:00
Authentication code: 1152

Re: PerlMagick Get() attributes: only partially working in v7.0.8

Post by E. Fudd Wabbitwy »

Sorry, magick. I opted to go back to 6.9.7 for the moment in order to get this project done. I've got more to do and hope to get back to another try at upgrading to 7.0, and SetPixels().

Thank you.

E. Fudd Wabbitwy
Posts: 27
Joined: 2019-09-18T08:46:14-07:00
Authentication code: 1152

Re: PerlMagick Get() attributes: only partially working in v7.0.8

Post by E. Fudd Wabbitwy »

And, I'm back (sorry).

My earlier attempt to install ImageMagick, v7.0.8, with PerlMagick, in Ubuntu 18.04, along with my attempts to remove it, in order to reinstall Ubuntu's "standard" version, 6.9.7, resulted in silent failure, by which I mean, the reinstall of 6.9.7 did not, completely, succeed, but with no obvious indications of failure.

After finally discovering that SetPixel() was giving really weird results reading .PNG files, I decided to verify that it, really, was set up to read them (it was reading the Get('attribute') data just fine).

I ran:

Code: Select all

magick -list configure
or rather, I attempted to, because I got this bombshell:
Command 'magick' not found, did you mean:

command 'magic' from deb magic

Try: sudo apt install <deb name>
Lovely... looks like imagemagick pkg wasn't installed by the pkg manager (apt), but attempts to "install" it said that it was. So I've ruined or at least munged the ability to install the Ubuntu-supported version of ImageMagick.

...Proceeding... I removed and purged the 6.9.7 package and re-installed version 7.0.8 from source.

Running the same "magick -list configure" under 7.0.8 indicates support for a very short list of formats:

Code: Select all

DELEGATES             mpeg ps
DELEGATES
I clearly missed Something Large.

However, at the same time, the install seems mostly happy:

Code: Select all

% convert logo: logo.gif # WORKED
% make check # FAILED on only two items
FAIL: tests/wandtest.tap 1
FAIL: Magick++/demo/demos.tap 6
Ghostscript is INSTALLED, but my pkg manager does not know about Freetype. [EDIT: I found a pkg called freetype2-demos and installed that on a whim, and reran the make check, with the same two failed results.][EDIT: I found some Ubuntu-specific install instructions, which calls for first installing a kitchen-sink-ful of things which, I guess, "might" be looked for during installation, and one of the things listed was 'libfreetype6.']

Can you advise me?
Thank you.

E. Fudd Wabbitwy
Posts: 27
Joined: 2019-09-18T08:46:14-07:00
Authentication code: 1152

Re: PerlMagick Get() attributes: only partially working in v7.0.8

Post by E. Fudd Wabbitwy »

Re: Ubuntu (18.04)-specific install instructions found here:
https://linuxconfig.org/how-to-install- ... 8-04-linux

The "specific" part is, I think, this step:

Code: Select all

% sudo apt build-dep imagemagick
which, I think, inspects the imagemagick package for dependencies [but the old one, offered through the 'apt' system] and installs those before attempting any compilations from source.

====

Reinstalling following these steps (and changing the "./configure" step to "./configure --with-perl") installs 7.0.8 with this result:

Code: Select all

% magick -list configure|grep DELEGATE
DELEGATES             bzlib djvu mpeg fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pango png ps tiff wmf x xml zlib
DELEGATES             bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
AND

Code: Select all

% make check
PASS: 86 everything as well.

I believe v7.0.8 is working, and the result is that my project is failing in a much more modern fashion... ;^)

Locked