in reply to Re^2: Image modules not returning or accepting GD::Image
in thread Image modules not returning or accepting GD::Image
In the actual code, I still create a GD::Image so that I can read the width
No need. PDF::API2 has methods to get image size. + Using PDF::API2::image_whatever directly is safe, BTW.
use strict; use warnings; use feature 'say'; use open IO => ':raw'; use GD; use PDF::API2; my $gd_obj = GD::Image-> new( scalar qx/convert rose: png:-/ ); my $pdf = PDF::API2-> new; my $pdf_image = $pdf-> image_gd( $gd_obj ); say $pdf_image-> width; say $pdf_image-> height;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Image modules not returning or accepting GD::Image
by Bod (Parson) on Dec 05, 2022 at 22:55 UTC |