Skip to content

Instantly share code, notes, and snippets.

@Mad182
Last active September 1, 2017 11:53
Show Gist options
  • Save Mad182/169af152c7f8c720a3f8 to your computer and use it in GitHub Desktop.
Save Mad182/169af152c7f8c720a3f8 to your computer and use it in GitHub Desktop.
gif resize
//coalesce and resize as seen on https://ezgif.com/resize
exec(CONVERT . " '" . IMG_PATH . "/tmp/" . $file . "' -coalesce '" . IMG_PATH . "/tmp/coalesce_" . $file . "'");
exec(CONVERT . " -size " . $imsize[0] . "x" . $imsize[1] . " '" . IMG_PATH . "/tmp/coalesce_" . $file . "' -resize " . $width . "x" . $height . " '" . IMG_PATH . "/tmp/nonopt_" . $out . "'");
//compress to save bandwidth
exec(GIFSICLE . " -O3 --lossy=30 '" . IMG_PATH . "/tmp/nonopt_" . $out . "' >'" . IMG_PATH . "/tmp/" . $out . "'");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment