Last active
November 25, 2026 01:22
-
-
Save easierbycode/9aabfd0c95a62b87380dc67ce632c902 to your computer and use it in GitHub Desktop.
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 characters
| Get-ChildItem -Recurse -Filter *.heic | % { | |
| $out = Join-Path $_.DirectoryName ($_.BaseName + '.jpg') | |
| $h = if ($_.Length -ge 12) { [byte[]](Get-Content $_.FullName -Encoding Byte -TotalCount 12) } | |
| if (-not $h) { | |
| '{0}: EMPTY ({1} bytes)' -f $_.FullName, $_.Length | |
| } elseif ($h[0] -eq 0xFF -and $h[1] -eq 0xD8) { | |
| Copy-Item $_.FullName $out | |
| } elseif ([Text.Encoding]::ASCII.GetString($h,4,4) -eq 'ftyp') { | |
| magick $_.FullName -quality 90 $out | |
| } else { | |
| '{0} ({1} bytes): {2}' -f $_.FullName, $_.Length, (($h | % { '{0:X2}' -f $_ }) -join ' ') | |
| } | |
| } |
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 characters
| winget install Gyan.FFmpeg | |
| ffmpeg -i IMG_2985.mov -frames:v 1 IMG_2985.jpg |
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 characters
| cd C:\Users\Owner\Pictures | |
| ffprobe IMG_3149.mov |
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 characters
| Get-ChildItem -Recurse -Filter *.heic | ? { [Text.Encoding]::ASCII.GetString([byte[]](Get-Content $_.FullName -Encoding Byte -TotalCount 12),4,6) -eq 'ftypqt' } | Rename-Item -NewName { $_.BaseName + '.mov' } |
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 characters
| Get-ChildItem *.heic | % { '{0} ({1:N0} bytes): {2}' -f $_.Name, $_.Length, [Text.Encoding]::ASCII.GetString([byte[]](Get-Content $_.FullName -Encoding Byte -TotalCount 12),4,8) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment