Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
#!/usr/bin/perl # Take all in InRotation # Scale them down # Add the byline on top # Save them to done # Anything with a -c.png is a color pic, and should be save as a .jpg, + not a # .gif $|=1; use Image::Magick; $byline=Image::Magick->new; $byline->Read('StalagComicTitle.gif'); $from="./InRotaton"; $to="./done"; opendir(DIR,$from) || die "Something: $!"; @d = grep {/^\d+/} readdir(DIR); closedir(DIR); @d1=sort @d; # print @d1; # exit; while(@d1) { $f=shift @d1; print "Working on $f... "; $f =~ /^([^.]+)\./; $fo=$1; $color=0; $color++ if($f =~ /-c\.png$/); $fo .= ($color ? ".jpg" : ".gif" ); $img = Image::Magick->new; $img->Set(size=>"720x1024"); $img->ReadImage("null:white"); $src = Image::Magick->new; $src->Read("$from/$f"); $src->Resize(geometry=>"720x720",filter=>"Cubic",blur=>.5); ($w,$h)=$src->Get('width','height'); $h+=16; $img->Composite(compose=>'Replace',image=>$byline,x=>0,y=>0); $img->Composite(compose=>'Replace',image=>$src,x=>0,y=>16); $img->Crop(x=>0,y=>0,width=>$w,height=>$h); unless($color) { $img->Quantize(colors=>16); $img->Write("$to/temp.pgm"); system "ppmtogif $to/temp.pgm > $to/$fo"; } else { $img->Write("$to/$fo"); } print "done.\n"; }

In reply to Stalag '99 comic strip compiler by strredwolf

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (8)
    As of 2014-12-25 08:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (159 votes), past polls