Skip to content

Instantly share code, notes, and snippets.

@fuba
Created March 20, 2011 16:56
Show Gist options
  • Select an option

  • Save fuba/878450 to your computer and use it in GitHub Desktop.

Select an option

Save fuba/878450 to your computer and use it in GitHub Desktop.

Revisions

  1. fuba created this gist Mar 20, 2011.
    17 changes: 17 additions & 0 deletions mpo2gif
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/sh
    # mpo2gif
    # convert a .mpo file to a animation gif.
    # this idea is from http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=16275
    # this script requires exiftool and imagemagick.

    rjpg=/tmp/$$_r.jpg
    ljpg=/tmp/$$_l.jpg

    echo $1
    gif=`basename $1 .MPO`.gif

    exiftool -trailer:all= $1 -o $rjpg
    exiftool $1 -mpimage2 -b > $ljpg
    convert -loop 0 -delay 5 $ljpg -delay 5 $rjpg $gif

    rm $rjpg $ljpg