Results 1 to 3 of 3

Thread: Determining a photo's hieight & width

  1. #1
    IV Amateur jackw's Avatar
    Join Date
    Apr 2013
    Location
    NE Florida
    Posts
    10
    Version
    IrfanView 4.38
    OS
    32-bit Win XP Pro SP3
    CPU Cores
    4

    Default Determining a photo's hieight & width

    I am currently supporting a website using Rexx under eCS 1.2R and an old graphics program called Jview. The reason that I use Jview is that it provides an API for Rexx that allows a script to directly control the processing of one or more photos in almost any way that you can imaging. For reasons that I won't go into here I'm thinking of migrating that support to Windows and I am sure that Infranview can be used to do the same job under Windows except for one feature. Does any know of a Windows utility that will return the height and width of a photo?

  2. #2
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    It depends how you want them returned. Irfanview can display height and width in the Information dialog, the Status bar or as text on a full screen image.

    I imagine that you want to record the results though, without having to write them down yourself. If so you could run an Irfanview batch process either manually or automatically and rename the files with the height and width of each image as part of its new name.

    Otherwise, you could write a script using the /info option as part of a Command line and extract the height and width data from the text file that it produces.
    Foxy posted a sample Batch file some years back which could extract those parameters. I cannot find it with a forum search, so assume that it is no longer here. Fortunately I saved it, so reproduce it below so that you can see if it is what you want.

    Code:
    The following batch script:
    
            @echo off
            cls
            setlocal
    
            :: --- Configuration --->
    
            :: Temp-/Infofile path/name
            set info=%temp%\info.txt
    
            :: IrfanView
            set iview=C:\IrfanView\i_view32.exe
    
            :: <--- Configuration ---
    
            %iview% %1 /info=%info%
    
            for /f "tokens=4,6" %%a in ('type %info% ^| find.exe /i "Image dimensions"') do (set /a width=%%a) & (set /a height=%%b)
    
            echo File: %1
            echo Width: %width% Pixel
            echo Height: %height% Pixel
            echo.
    
            if exist %info% del %info%
            endlocal
    
    returns the dimensions (width and height) of a specified pic, if you run this script as follows:
    Syntax:
    picdim.cmd [[Drive:][Path]Filename]

    Example:
    picdim.cmd "C:\MyPictures\subfolder 01\abcd 0123.jpg"

  3. #3
    IV Amateur jackw's Avatar
    Join Date
    Apr 2013
    Location
    NE Florida
    Posts
    10
    Version
    IrfanView 4.38
    OS
    32-bit Win XP Pro SP3
    CPU Cores
    4

    Default

    The website that I'm supporting, The Fanac Fan History Project, had 11,737 photos on-line as of the 1st of this month and I uploaded almost all of them myself. This something that you don't do one at a time by hand, at least I don't! It is my understanding that it a "good" HTML practice to include the height and with of a photo in it's image tag so I have been doing that, using Jview to gather the information as well as resizing photos, generating thumbnails, etc., since our start in 1997. As I mentioned earlier, I use Rexx scripts which I'll more over to Windows so this looks like a possible solution, I'll just have to convert the idea to a Rexx script.

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •