use imagemagick and a shell script.
identify -format "[\"%f\",%w,%h]\n" *.jpg
should give you the JS arrays, one per line. You can pipe this into a
text file using f.e.
identify -format "[\"%f\",%w,%h];\n" *.jpg > arrays.js
See http://www.imagemagick.org/script/escape.php for details on the
parameter syntax.
Depending on your windows version shell uses ANSI character set and
javascript will assume Unicode. So special characters like german
umlauts will be changed. If this happens you might want to read
http://ss64.com/nt/cmd.html
--
Erik Krause
http://www.erik-krause.de
Sorry, I forgot: The aqbove syntax is for direct use on the command
line. If you use it in a batch script you must double all % characters:
...
identify -format "[\"%%f\",%%w,%%h];\n" *.jpg >arrays.js
...
> I think something more primitive, perhaps.
There isn't anything more primitive than a command line.
Oh, well, you can try to use Javascript, f.e. Windows Scripting Host
understands Javascript. Have fun ;-)
Hey John.
At work I swear on ImageMagick, I don't know how else I'd crop and convert 15'000 images in one go (that's not a typo!) :)
I'm also using TotalCommander [1] for general file handling.
TotalCommander has a bunch of plugins for Catloging files and general stuff [2]. Maybe you can coax the Catalog-Plugin to output what you want to a .txt-file, but I'd really suggest (as Erik) to install ImageMagick, fire up that DOS-console and start with his suggestion, it's not that complicated...
After you've installed it from http://is.gd/buwCo and use "Start" > "Run" > cmd you should be greeted with your well known DOS-window. Navigate to the folder with the images and enter:
---
identify -format "[\"%f\",%w,%h];\n" *.jpg > arrays.js
---
and you should have your desired list.
Habi
BTW: Thanks Erik for that tip, I didn't know this :)
[1]: http://www.ghisler.com/, shareware, but I got an site-license from the University...
[2]: http://www.ghisler.com/plugins.htm
Reading again I think it's actually
identify -format "[\"%f\",%w,%h]," *.jpg> arrays.js
what he wants :-)
However, to create websites I'd suggest using PHP (with GD).
getimagesize() returns (among others) the complete width and height
attributes for the IMG tag directly...
type "dir >dir.txt"
dir.txt now has a listing of the contents of the directory but it has the
date time and size as well but everything is in a line vertically.