1
0
Fork 0

strip-metadata: update

This commit is contained in:
Daniel Kempkens 2024-09-26 17:19:52 +02:00
parent abbdf07583
commit b3836e31b2
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -4,11 +4,19 @@ def main [path: string] {
glob $path | each { |item| glob $path | each { |item|
match ($item | path parse | get extension | str downcase) { match ($item | path parse | get extension | str downcase) {
"jpg" | "jpeg" | "png" => { "jpg" | "jpeg" | "png" => {
do -i {
xattr -d com.apple.metadata:kMDItemWhereFroms $item
xattr -d com.apple.metadata:kMDItemComment $item
}
exiftool -all= -overwrite_original_in_place $item exiftool -all= -overwrite_original_in_place $item
}, },
"mp4" => { "mp4" => {
let tmp_item = $"($item)_out.mp4" let tmp_item = $"($item)_out.mp4"
do -i {
xattr -d com.apple.metadata:kMDItemWhereFroms $item
xattr -d com.apple.metadata:kMDItemComment $item
}
ffmpeg -i $item -map_metadata -1 -c:v copy -c:a copy $tmp_item ffmpeg -i $item -map_metadata -1 -c:v copy -c:a copy $tmp_item
rm $item rm $item
mv $tmp_item $item mv $tmp_item $item