Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: thumbnails generator

by spx2 (Deacon)
on Apr 20, 2008 at 16:17 UTC ( [id://681796]=note: print w/replies, xml ) Need Help??


in reply to Re: thumbnails generator
in thread thumbnails generator

I agree but I don't know much bash/shell scripting so I'm using what I know.
Also shell scripting is not very flexible.In particular,what you wrote there
in brackets "do whatever with $size here" will probably not be accomlished
very easily using shell scripting.

Replies are listed 'Best First'.
Re^3: thumbnails generator
by oko1 (Deacon) on Apr 20, 2008 at 16:25 UTC

    Actually, it is indeed accomplished very easily. The fact that it's so complicated in your script is a demonstration that you're coercing a square peg into a round hole.

    size=`/usr/bin/identify "$image"|/usr/bin/cut -d' ' -f 3` /usr/bin/convert -geometry "$size" "$old_name" "$new_name"
    
    -- 
    Human history becomes more and more a race between education and catastrophe. -- HG Wells
    

      Of course given a better shell you can do even more inline:

      size=${=${$(identify "$image")}[3]}

      (And people say Perl is executable line noise . . . :)

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-28 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found