Mailinglist Archive: opensuse (3675 mails)

< Previous Next >
Re: [SLE] manipulating jpg-imgs from the command line..
  • From: Anders Johansson <andjoh@xxxxxxxxxxxxxxxxxxxxx>
  • Date: Sun, 20 Jan 2002 21:15:22 +0100
  • Message-id: <200201202015.g0KKF4p01465@xxxxxxxxxxxxxxxxxxxxx>
On Sunday 20 January 2002 20.47, Johannes Liedtke wrote:
> On Sunday 20 January 2002 18:52, Anders Johansson wrote:
> > On Sunday 20 January 2002 18.25, Johannes Liedtke wrote:
> > > "rdjpgcom -verbose img_0002.jpg"
> >
> > ImageMagick is your friend
> >
> > identify -format "%w %h" img_0002.jpg
> >
> > There are many ways to play around with this.
>
> but "identify" seems to be returning strings, so I'm again unable to
> compare height and width of the images... :(
>
> I guess I need sth like the java parseInt()-function...

Not at all. bash can handle it

#!/bin/bash

width=`identify -format "%w" test.jpg`
height=`identify -format "%h" test.jpg`
if [ $width -gt $height ]
then
echo "width greater than height"
fi

regards
Anders

< Previous Next >