JPEG Command line tool ?

Discussion in 'Digital Photography' started by Sideshow Mel, Dec 16, 2003.

  1. Sideshow Mel

    Sideshow Mel Guest

    looking for a command line tool
    to give me width and height of a jpeg file ?
    It should determine actual size and not read from
    EXIF
    thanks
     
    Sideshow Mel, Dec 16, 2003
    #1
    1. Advertising

  2. Sideshow Mel

    Wendy S Guest

    Wendy S, Dec 16, 2003
    #2
    1. Advertising

  3. Sideshow Mel

    Guest

    Sideshow Mel <> wrote:
    > looking for a command line tool
    > to give me width and height of a jpeg file ?
    > It should determine actual size and not read from
    > EXIF


    Imagemagick from www.imagemagick.com. There is one component
    called 'identify' that

    describes the format and characteristics of one or more
    image files. It will also report if an image is incomplete or
    corrupt. The information displayed includes the scene number,
    the file name, the width and height of the image, whether the
    image is colormapped or not, the number of colors in the image,
    the number of bytes in the image, the format of the image (JPEG,
    PNM, etc.), and finally the number of seconds it took to read
    and process the image.

    according to their manual page. Available for UNIX/Linux, Windows,
    MacOS and source if you want to try to compile it for somehting
    else. ;)
     
    , Dec 16, 2003
    #3
  4. There is a roundabout way of getting there - download jpegtran.exe
    (or zip) from: http://sylvana.net/jpegcrop/jpegtran/ (69KB)

    The output contains more than you need, but it should be possible to
    extract this. (You could download the source code if you are keen!)

    >jpegtran.exe -verbose inputfile.jpg outputfile.jpg


    Independent JPEG Group's JPEGTRAN, version 6b 27-Mar-1998
    Copyright (C) 1998, Thomas G. Lane
    Start of Image

    <snip>

    Start Of Frame 0xc0: width=200, height=134, components=3

    <snip>

    End Of Image


    "Sideshow Mel" <> wrote in message
    news:MLtDb.1019$...
    > looking for a command line tool
    > to give me width and height of a jpeg file ?
    > It should determine actual size and not read from
    > EXIF
    > thanks
     
    Gordon Richardson, Dec 16, 2003
    #4
  5. Sideshow Mel

    R2D2 Guest

    "Gordon Richardson" <> wrote in
    news::

    > There is a roundabout way of getting there - download jpegtran.exe
    > (or zip) from: http://sylvana.net/jpegcrop/jpegtran/ (69KB)
    >
    > The output contains more than you need, but it should be possible to
    > extract this. (You could download the source code if you are keen!)
    >
    >>jpegtran.exe -verbose inputfile.jpg outputfile.jpg

    >
    > Independent JPEG Group's JPEGTRAN, version 6b 27-Mar-1998
    > Copyright (C) 1998, Thomas G. Lane
    > Start of Image
    >
    > <snip>
    >
    > Start Of Frame 0xc0: width=200, height=134, components=3
    >
    > <snip>
    >
    > End Of Image
    >
    >
    > "Sideshow Mel" <> wrote in message
    > news:MLtDb.1019$...
    >> looking for a command line tool
    >> to give me width and height of a jpeg file ?
    >> It should determine actual size and not read from
    >> EXIF
    >> thanks

    >
    >
    >


    This is not a camcorder group.
     
    R2D2, Dec 16, 2003
    #5
  6. Perl does this fairly well:

    use Image::Size;

    ($width, $height) = imgsize("$filename");


    David.




    "Sideshow Mel" <> wrote in message
    news:MLtDb.1019$...
    > looking for a command line tool
    > to give me width and height of a jpeg file ?
    > It should determine actual size and not read from
    > EXIF
    > thanks
    >
     
    David Metcalfe, Dec 16, 2003
    #6
  7. Sideshow Mel

    Guest

    Sideshow Mel <> wrote:

    > looking for a command line tool
    > to give me width and height of a jpeg file ?
    > It should determine actual size and not read from


    m$ jhead 041.jpg | awk '/^Resolution/ { print $3, $5; }'
    511 511
    m$

    This is not a unique solution. However, you could have obtained an
    equivalent in about as much time as it took me to type it in by
    grepping the Internet at www.google.com...

    nb. perl is for weenies.
     
    , Dec 16, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Trevor Smithson
    Replies:
    5
    Views:
    1,044
    Blinky the Shark
    May 25, 2005
  2. Kue2

    Wmic command-line tool in Vista 64

    Kue2, Oct 18, 2007, in forum: Windows 64bit
    Replies:
    0
    Views:
    523
  3. chuckcar
    Replies:
    11
    Views:
    9,664
    §ñühw¤£f
    Apr 21, 2009
  4. Evan Platt
    Replies:
    1
    Views:
    936
    John Holmes
    Apr 18, 2009
  5. §ñühw¤£f
    Replies:
    2
    Views:
    1,589
    §ñühw¤£f
    Apr 19, 2009
Loading...

Share This Page