User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)
4 posts Page 1 of 1
Hello there,

I have a quick question regarding how to list all images and their dimensions (width and height) in a directory.
I need to read and ideally write to a text file all image file names with the dimensions to be used in a XML document.
I only need to read .png, .jpg and .gif files from the folder.

I have tried using the DOS dir command without success as it can only list file names but not image resolution information, which I happen to need for my current project.

Thank you in advance for your help.
There is a little command line tool that you can use, and set up as a tool within UE. (Capturing the output to the editor, you should be able to configure it to do what you want.) It's "Image Dimensions" (ImDim.exe), and is available at http://www.gdargaud.net/Hack/Utils.html

It can only handle JPG and PNG files, however, not GIF. You'll need to locate a different utility or have one written if you need to do that as well.

Another solution might be to use IrfanView from the command line. There is a discussion about using IrfanView to get image dimensions and put them in a text file at http://irfanview-forum.de/showthread.ph ... mmand-line

Not a complete answer, but a point in the right direction to start your search.
Foxy in IrfanView forum made a very good job. His batch script is working fine. I changed the line with the file extensions definition to

Code: Select all
set filext=*.gif *.jpg *.png

and inserted an extra space on line

Code: Select all
echo Width:  %width% Pixel >> "%dims%"

to get a perfect alignment with the Height: line below in the output file. Of course the values for the environment variables dims and iview needed to be adpated to my local directory structure too. But then the batch script was ready and produces a text file which can be processed further by UltraEdit macros or scripts.
Thanks to both of you for point me to the right tool.

And thanks also to foxy for his script.

It is now working and getting the dimensions for the files I need.
4 posts Page 1 of 1