gif2png 272 B

123456789101112131415
  1. #!/bin/bash
  2. extract_gif_to_png()
  3. {
  4. local bname="$(basename $1)"
  5. local dname="${bname%.*}"
  6. if [ -d "$dname" ]; then
  7. echo "directory ($dname) already exists..."
  8. return
  9. fi
  10. mkdir -p "$dname"
  11. convert -coalesce "$bname" "${dname}/%03d.png"
  12. }
  13. extract_gif_to_png "$1"