Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
a few comments:
  • try $b->{debug} = 1; between 'new' and 'brand' lines ... anything useful?
  • note you should probably pass a format=>'jpg' param as well (happens to default to jpg)
  • is the target really 'xjpg' or should that be 'x.jpg'? maybe w/o an extension Image::Magick can't figure it out?
  • Do you have the proper libs installed? Can you use straight IM code (two new/Read's and a Composite) and does that work?
    use Image::Magick; my $image = Image::Magick->new(); $image->ReadImage( 'x.jpg' ); my $pic = Image::Magick->new(); $pic->ReadImage( 'x.gif' ); $pic->Scale( width=>$w, height=>$h ); $image->Composite( image=>$pic, x=>$x, y=>$y, compose=>'Over' ); $image->Write( 'xb.jpg' );
  • note that Image::Magick::Brand is just a very simple (and limited) wrapper around the Composite() method so if the problem is there it's easy enough to just not use it .. (see above item for code)

Also, using Imager may be an alternative:
use Image; my $image = Imager->new; $image->read(file=>'x.jpg', type=>'jpeg') or die "Cannot read: + ", $image->errstr; my $pic = Imager->new; $pic->read(file=>'x.gif', type=>'gif') or die "Cannot read: ", + $pic->errstr; $image->paste( left=>$x, top=>$y, img=> $pic->scale( xpixels=>$w, ypixels=>$h, type=>'min' ), ); $image->write(file=>"xb.jpg");

In reply to Re: Image Magick branding module crash by davidrw
in thread Image Magick branding module crash by GrandFather

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2021-12-04 19:06 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (30 votes). Check out past polls.