Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Alternative to $image->copy() in GD module

by pryrt (Abbot)
on Jul 06, 2016 at 21:44 UTC ( [id://1167337]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Alternative to $image->copy() in GD module
in thread Alternative to $image->copy() in GD module

I assume that you already evaluated and rejected the similarly-named GD::SVG, which does implement the copy method (but not clone, copyMerged, etc.). (I've never used either, so I don't know the merits of one over the other.)

You might want to try to roll your own sub SVG::GD::Image::copy { ... }: create the initial image with SVG::GD::Image::new(); use Data::Dumper (or similar) to get the details of the SVG::GD::Image object and find all the attributes/data that are important to you, and copy those attributes from the original to the new. I think you can just define it in your own code using the fully-qualified package:: name, but if not, put it in your installed copy of SVG/GD.pm (assuming you have write privileges).

Once you've got it working, you can send it to the maint of SVG::GD as a feature request; having written the code already, it's much more likely to make it in. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-03-28 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found