Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Image modules not returning or accepting GD::Image

by Anonymous Monk
on Dec 03, 2022 at 05:25 UTC ( [id://11148518]=note: print w/replies, xml ) Need Help??


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

    Ah!
    That's very helpful - thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2024-04-18 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found