diff --git a/content/blog/2026-01-02-week-2-new-year/thinkpad_t480s.jpg b/content/blog/2026-01-02-week-2-new-year/thinkpad_t480s.jpg index e4cf532..e269e5c 100644 Binary files a/content/blog/2026-01-02-week-2-new-year/thinkpad_t480s.jpg and b/content/blog/2026-01-02-week-2-new-year/thinkpad_t480s.jpg differ diff --git a/convert-images.sh b/convert-images.sh index 6a05091..559aa1c 100755 --- a/convert-images.sh +++ b/convert-images.sh @@ -1,7 +1,25 @@ #!/bin/bash +# Convert HEIC/HEIF to JPG and resize to max 2000px on either side find content -type f \( -iname "*.heic" -o -iname "*.heif" \) | while read -r file; do output="${file%.*}.jpg" - magick "$file" -quality 85 "$output" + magick "$file" -resize '2000x2000>' -quality 85 "$output" echo "Converted $file to $output" -done \ No newline at end of file + + # Strip GPS data from the converted image + exiftool -gps:all= -overwrite_original "$output" + echo "Stripped GPS data from $output" + + # Delete the original HEIC/HEIF file after successful conversion + rm "$file" + echo "Deleted $file" +done + +# Strip GPS data from existing JPG, JPEG, and PNG files +find content -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | while read -r file; do + # Check if file has GPS data before processing + if exiftool -gps:all "$file" | grep -q "GPS"; then + exiftool -gps:all= -overwrite_original "$file" + echo "Stripped GPS data from $file" + fi +done