COMPRESS DIC PICS.sh 524 B

123456789101112131415161718
  1. mkdir -p processed # Ensure the processed directory exists
  2. for f in ./*.*; do
  3. filename=$(basename "$f")
  4. # Process the file with ffmpeg
  5. avifenc -q 30 "$f" "processed/${filename}.avif"
  6. # Get the modification time of the original file
  7. original_mod_time=$(stat -c %y "$f")
  8. # Apply the modification time to the processed file
  9. touch -m -d "$original_mod_time" "processed/${filename}.avif"
  10. done
  11. for f in processed/*.*; done
  12. mv "processed/${filename}.avif" "processed/${filename}.jpg"
  13. done