Last active
July 8, 2022 22:59
-
-
Save jtmoon79/eea39c3f9b3d37a169286da8f7788512 to your computer and use it in GitHub Desktop.
Revisions
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -78,6 +78,7 @@ function ProcessJPG # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used # # XXX: the camera picture file embedded tagging varies tremendously; this works for my # set of .jpg files & "$exiftool" -verbose -verbose -extractEmbedded ` -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,11 +52,12 @@ function PrintDates # functions Process* # set the file system file attributes (`File:FileAccessDate` is typically not writable) # # XXX: `File:FileAccessDate` sometimes ends up matching the last changed datetime value, # i.e. a change to `File:FileModifyDate` has a side-affect of setting `File:FileAccessDate` # to the same value. # # BUG: `File:FileCreateDate` often fails to change, will `ForceCreateDate` help? # most likely failure is due to the file being on a Unix Samba share, and # the Samba share settings disallowing this change due to some combination # of factors -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,7 +57,7 @@ function PrintDates # to the same value. # BUG: `File:FileCreateDate` often fails to change, will this help? # most likely failure is due to the file being on a Unix Samba share, and # the Samba share settings disallowing this change due to some combination # of factors function ForceCreateDate { -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,8 +57,9 @@ function PrintDates # to the same value. # BUG: `File:FileCreateDate` often fails to change, will this help? # most likely failiure is due to the file being on a Unix Samba share, and # the Samba share settings disallowing this change due to some combination # of factors function ForceCreateDate { Param( [Parameter(Mandatory=$true)][String]$file -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,8 +56,8 @@ function PrintDates # i.e. a change to `File:FileModifyDate` has a side-affect of setting `File:FileAccessDate` # to the same value. # BUG: `File:FileCreateDate` often fails to change, will this help? # most likely failiure is due to the file being on a Unix Samba share, and so # some loss in translation Windows SMB -> Unix SMB function ForceCreateDate { Param( -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,7 +56,9 @@ function PrintDates # i.e. a change to `File:FileModifyDate` has a side-affect of setting `File:FileAccessDate` # to the same value. # BUG: `File:FileCreateDate` often fails to change # most likely due to the file being on a Unix Samba share, and so # some loss in translation Windows SMB -> Unix SMB function ForceCreateDate { Param( [Parameter(Mandatory=$true)][String]$file -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,8 +55,8 @@ function PrintDates # XXX: `File:FileAccessDate` sometimes ends up matching the last changed datetime value, # i.e. a change to `File:FileModifyDate` has a side-affect of setting `File:FileAccessDate` # to the same value. # BUG: `File:FileCreateDate` often fails to change, will this help? function ForceCreateDate { Param( [Parameter(Mandatory=$true)][String]$file -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,6 +57,14 @@ function PrintDates # to the same value. # BUG: `File:FileCreateDate` often fails to change function ForceCreateDate { Param( [Parameter(Mandatory=$true)][String]$file ) $date_lastwritetime = (Get-Item $file).LastWriteTime (Get-Item $file).CreationTime = $date_lastwritetime } function ProcessJPG { Param( -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -134,7 +134,7 @@ try { ProcessMP4 $Path # see datetime attributes after PrintDates $Path # user passed single .avi file } elseif ((Test-Path -Path $Path -PathType Leaf) -AND $Path.EndsWith(".avi", $compare)) { # see datetime attributes before PrintDates $Path -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ function PrintDates Param( [Parameter(Mandatory=$true)][String]$file ) Write-Verbose "$exiftool -time:all -groupHeadings -short -duplicates '$file'" & "$exiftool" -time:all -groupHeadings -short -duplicates $file } @@ -62,7 +62,7 @@ function ProcessJPG Param( [Parameter(Mandatory=$true)][String]$file ) Write-Verbose "$exiftool '$file'" # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used @@ -81,7 +81,7 @@ function ProcessMP4 Param( [Parameter(Mandatory=$true)][String]$file ) Write-Verbose "$exiftool '$file'" # set the file system file attributes (`File:FileAccessDate` is typically not writable) & "$exiftool" -verbose -verbose -extractEmbedded ` '-Quicktime:CreateDate>File:FileCreateDate' ` @@ -94,7 +94,7 @@ function ProcessAVI Param( [Parameter(Mandatory=$true)][String]$file ) Write-Verbose "$exiftool '$file'" # set the file system file attributes (`File:FileAccessDate` is typically not writable) & "$exiftool" -verbose -verbose -extractEmbedded ` '-RIFF:DateTimeOriginal>File:FileCreateDate' ` -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,7 +66,7 @@ function ProcessJPG # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used # XXX: the camera picture file embedded tagging varies tremendously; this works for my # set of .jpg files & "$exiftool" -verbose -verbose -extractEmbedded ` '-EXIF:DateTimeOriginal>File:FileCreateDate' ` -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,7 +66,7 @@ function ProcessJPG # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used # XXX: the camera picture file embedded tagging varies tremendously among cameras; this works for my # set of .jpg files & "$exiftool" -verbose -verbose -extractEmbedded ` '-EXIF:DateTimeOriginal>File:FileCreateDate' ` -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,6 +66,8 @@ function ProcessJPG # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used # XXX: the approach to camera picture file embedded tagging varies tremendously; this works for my # set of .jpg files & "$exiftool" -verbose -verbose -extractEmbedded ` '-EXIF:DateTimeOriginal>File:FileCreateDate' ` '-EXIF:CreateDate>File:FileCreateDate' ` -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,17 +50,22 @@ function PrintDates & "$exiftool" -time:all -groupHeadings -short -duplicates $file } # functions Process* # set the file system file attributes (`File:FileAccessDate` is typically not writable) # XXX: `File:FileAccessDate` sometimes ends up matching the last changed datetime value, # i.e. a change to `File:FileModifyDate` has a side-affect of setting `File:FileAccessDate` # to the same value. # BUG: `File:FileCreateDate` often fails to change function ProcessJPG { Param( [Parameter(Mandatory=$true)][String]$file ) Write-Verbose "$exiftool $file" # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used & "$exiftool" -verbose -verbose -extractEmbedded ` '-EXIF:DateTimeOriginal>File:FileCreateDate' ` '-EXIF:CreateDate>File:FileCreateDate' ` -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,7 +82,7 @@ function ProcessMP4 $file } function ProcessAVI { Param( [Parameter(Mandatory=$true)][String]$file @@ -128,10 +128,10 @@ try { # see datetime attributes after PrintDates $Path # user passed single .mov file } elseif ((Test-Path -Path $Path -PathType Leaf) -AND $Path.EndsWith(".avi", $compare)) { # see datetime attributes before PrintDates $Path ProcessAVI $Path # see datetime attributes after PrintDates $Path # user passed directory @@ -145,9 +145,9 @@ try { Get-ChildItem $Path -Recurse -File -Filter "*.mp4" ` | Sort-Object -Property FullName ` | ForEach-Object { ProcessMP4 $_ } Get-ChildItem $Path -Recurse -File -Filter "*.avi" ` | Sort-Object -Property FullName ` | ForEach-Object { ProcessAVI $_ } # user passed unhandled file } else { Write-Error "Unhandled file $Path" -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -134,7 +134,7 @@ try { ProcessMOV $Path # see datetime attributes after PrintDates $Path # user passed directory } elseif (Test-Path -Path $Path -PathType Container) { Get-ChildItem $Path -Recurse -File -Filter "*.jpg" ` | Sort-Object -Property FullName ` -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
-
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 11 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -128,14 +128,14 @@ try { # see datetime attributes after PrintDates $Path # user passed single .mov file } elseif ((Test-Path -Path $Path -PathType Leaf) -AND $Path.EndsWith(".mov", $compare)) { # see datetime attributes before PrintDates $Path ProcessMOV $Path # see datetime attributes after PrintDates $Path # user passed directory } elseif (Test-Path -Path $Path -PathType Container) { Get-ChildItem $Path -Recurse -File -Filter "*.jpg" ` | Sort-Object -Property FullName ` | ForEach-Object { ProcessJPG $_ } @@ -145,6 +145,9 @@ try { Get-ChildItem $Path -Recurse -File -Filter "*.mp4" ` | Sort-Object -Property FullName ` | ForEach-Object { ProcessMP4 $_ } Get-ChildItem $Path -Recurse -File -Filter "*.mov" ` | Sort-Object -Property FullName ` | ForEach-Object { ProcessMOV $_ } # user passed unhandled file } else { Write-Error "Unhandled file $Path" -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -135,7 +135,7 @@ try { # see datetime attributes after PrintDates $Path # user passed directory } elseif (Test-Path -Path $Path -PathType Container) { Get-ChildItem $Path -Recurse -File -Filter "*.jpg" ` | Sort-Object -Property FullName ` | ForEach-Object { ProcessJPG $_ } -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -127,6 +127,13 @@ try { ProcessMP4 $Path # see datetime attributes after PrintDates $Path # user passed single .mov file } elseif ((Test-Path -Path $Path -PathType Leaf) -AND $Path.EndsWith(".mov", $compare)) { # see datetime attributes before PrintDates $Path ProcessMOV $Path # see datetime attributes after PrintDates $Path # user passed directory } elseif (Test-Path -Path $Path -PathType Container) { Get-ChildItem $Path -Recurse -File -Filter "*.jpg" ` -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,6 +82,19 @@ function ProcessMP4 $file } function ProcessMOV { Param( [Parameter(Mandatory=$true)][String]$file ) Write-Verbose "$exiftool $file" # set the file system file attributes (`File:FileAccessDate` is typically not writable) & "$exiftool" -verbose -verbose -extractEmbedded ` '-RIFF:DateTimeOriginal>File:FileCreateDate' ` '-RIFF:DateTimeOriginal>File:FileModifyDate' ` $file } try { # XXX: fallback path is hardcoded to my location $exiftool = "$HOME\Apps\exiftool-12.42\exiftool.exe" -
jtmoon79 revised this gist
Jul 8, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,6 +60,7 @@ function ProcessJPG # first use `EXIF:DateTimeOriginal` which is sometimes available and sometimes correct # then use `EXIF:CreateDate` which is sometimes avilable and often correct # hopefully the most appropriate date is used # BUG: `File:FileCreateDate` often fails to change & "$exiftool" -verbose -verbose -extractEmbedded ` '-EXIF:DateTimeOriginal>File:FileCreateDate' ` '-EXIF:CreateDate>File:FileCreateDate' ` -
jtmoon79 revised this gist
Jul 8, 2022 . No changes.There are no files selected for viewing
NewerOlder