[Vraag] Script om timestamps van foto's aan te passen

Pagina: 1
Acties:

Vraag


Acties:
  • 0 Henk 'm!

  • Quilt
  • Registratie: Oktober 2006
  • Niet online
rth; and the gathering together of
the waters called he Seas: and God saw that it was good.

1:11 And God said, Let the earth bring forth grass, the herb yielding
seed, and the fruit tree yielding fruit after his kind, whose seed is
in itself, upon the earth: and it was so.

1:12 And the earth brought forth grass, and herb yielding seed after
his kind, and the tree yielding fruit, whose seed was in itself, after
his kind: and God saw that it was good.

1:13 And the evening and the morning were the third day.

1:14 And God said, Let there be lights in the firmament of the heaven
to divide the day from the night; and let them be for signs, and for
seasons, and for days, and years: 1:15 And let them be for lights in
the firmament of the heaven to give light upon the earth: and it was
so.

1:16 And God made two great lights; the greater light to rule the day,
and the lesser light to rule the night: he made the stars also.

1:17 And God set them in the firmament of the heaven to give light
upon the earth, 1:18 And to rule over the day and over the night, and
to divide the light from the darkness: and God saw that it was good.

1:19 And the evening and the morning were the fourth day.

1:20 And God said, Let the waters bring forth abundantly the moving
creature that hath life, and fowl that may fly above the earth in the
open firmament of heaven.

1:21 And God created great whales, and every living creature that
moveth, which the waters brought forth abundantly, after their kind,
and every winged fowl after his kind: and God saw that it was good.

1:22 And God blessed them, saying, Be fruitful, and multiply, and fill
the waters in the seas, and let fowl multiply in the earth.

1:23 And the evening and the morning were the fifth day.

1:24 And God said, Let the earth bring forth the living creature after
his kind, cattle, and creeping thing, and beast of the earth after his
kind: and it was so.

[ Voor 88% gewijzigd door Quilt op 05-03-2021 09:44 ]

Alle reacties


Acties:
  • 0 Henk 'm!

  • Craven
  • Registratie: Februari 2007
  • Laatst online: 22:30
Bedoel je hiermee de windows timestamps (last modified, last accessed) of bedoel je de exif data?

Acties:
  • 0 Henk 'm!

  • u_nix_we_all
  • Registratie: Augustus 2002
  • Niet online
De data waar die timestamp opgeslagen is, heet EXIF data.
Met die zoekterm kwam ik dit tegen: http://www.sno.phy.queensu.ca/~phil/exiftool/#shift
Doet precies wat je vraagt, maar is wel een CLI (perl) tooltje, ik weet niet of je daarmee overweg kunt.

You don't need a parachute to go skydiving. You need a parachute to go skydiving twice.


Acties:
  • 0 Henk 'm!

  • Quilt
  • Registratie: Oktober 2006
  • Niet online
@Craven: Geen idee, eigenlijk. De data die door Picasa enz. gebruikt wordt om te sorteren. Wellicht exif idd.

@U_nix...: Bedankt. Ik kijk het na. Er is ook een Windows executable, ik denk dat het wel gaat lukken zo.
De use case die beschreven wordt is exact mijn situatie.

[ Voor 11% gewijzigd door Quilt op 25-01-2016 16:52 ]


Acties:
  • 0 Henk 'm!

  • Squ1zZy
  • Registratie: April 2011
  • Niet online
Waarom binaries downloaden waarvan je niet weet wat het doet?

PowerShell:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
param([string]$file)

function GetTakenData($image) {
    try {
        return $image.GetPropertyItem(36867).Value
    }   
    catch {
        return $null
    }
}

[Reflection.Assembly]::LoadFile('C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Drawing.dll') | Out-Null
$image = New-Object System.Drawing.Bitmap -ArgumentList $file
try {
    $takenData = GetTakenData($image)
    if ($takenData -eq $null) {
        return $null
    }
    $takenValue = [System.Text.Encoding]::Default.GetString($takenData, 0, $takenData.Length - 1)
    $taken = [DateTime]::ParseExact($takenValue, 'yyyy:MM:dd HH:mm:ss', $null)
    return $taken
}
finally {
    $image.Dispose()
}


PowerShell:
1
2
3
4
5
6
7
8
9
10
11
12
gci *.jpg | foreach {
    Write-Host "$_`t->`t" -ForegroundColor Cyan -NoNewLine 
    $date = (.\exif-datetaken.ps1 $_.FullName)
    if ($date -eq $null) {
        Write-Host '{ No ''Date Taken'' in Exif }' -ForegroundColor Cyan    
        return
    }
    $newName = $date.ToString('yyyy-MM-dd HH.mm.ss') + '.jpg'
    $newName = (Join-Path $_.DirectoryName $newName)
    Write-Host $newName -ForegroundColor Cyan
    mv $_ $newName
}