Sunday, June 8, 2008

The 'exif' program spits out an array of tags which I thought were consistently 56 lines (see below). (They are not of course.) So I attempted to query the 0 (filename) and the 20 (FNumber) per every group of 56 as if the output was an artificial array always 56 lines in length.

e.g. I am attempting to index an array of data by line number. This wasn't useful, but as an exercise in use of PS range operators and while construct. I am looking for some method to use PS to create objects from foreign data constructs. I think this may be approached more effectively else wise.


$exif_index = gci *.jpg | %{exif ($_.Name)}
$eil = $exif_index.length
$i = $eil

while ($i -gt 56)
{

$file_name = ($eil - ($i - 0))
$FNumber = ($eil - ($i - 20))
$exif_index[$file_name]
$exif_index[$FNumber]
## 56 is size of array
$i = ($i - 56)
}


Something like this results:
D:\images\06.04.08a
EXIF tags in 'P1050027.JPG' ('Intel' byte order):
FNumber |f/3.7
EXIF tags in 'P1050028.JPG' ('Intel' byte order):
FNumber |f/3.7
EXIF tags in 'P1050029.JPG' ('Intel' byte order):
FNumber |f/4.1
EXIF tags in 'P1050030.JPG' ('Intel' byte order):
FNumber |f/4.1

[full exif dump]

26# $exif_index | more
EXIF tags in 'P1050027.JPG' ('Intel' byte order):
--------------------+----------------------------------------------------------
Tag |Value
--------------------+----------------------------------------------------------
Manufacturer |Panasonic
Model |DMC-TZ1
Orientation |top - left
x-Resolution |72.00
y-Resolution |72.00
Resolution Unit |Inch
Software |Ver.1.0
Date and Time |2008:06:04 09:54:14
YCbCr Positioning |co-sited
Compression |JPEG compression
Orientation |top - left
x-Resolution |72.00
y-Resolution |72.00
Resolution Unit |Inch
YCbCr Positioning |co-sited
Exposure Time |1/800 sec.
FNumber |f/3.7

No comments: