Announcement

Collapse
No announcement yet.

Determining a photo's hieight & width

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    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"

    Comment


      #3
      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

      Comment

      Working...
      X