wp-cli/wp-cli — pull request #1003 by scribu (2014-02-09 15:36:11+00:00)
Title: Check that php-gd or php-imagick is available, before calling `wp media regenerate`

Came out of #591.

I think there might be a Wordpress function that does this.