Sunday, October 22, 2006

Print picture shootingdate

Ok, I've played around with the System.Drawing-namespace in C# to do some image manipulation. I've written a small Powershell-thingy to print the EXIF-shootingdate (ID 306) from jpeg-files in the current directory.

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") |
out-null
foreach ($file in (dir *.jpg)) {

$image = [system.drawing.image]::FromFile($file.FullName)
foreach ($property in $image.PropertyItems) {
if ($property.Id -eq 306) {
[Console]::WriteLine($file.FullName + " : " + [System.Text.Encoding]::ASCII.GetString($property.Value))
}
}
}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home