diff --git a/includes/i18n.php b/includes/i18n.php index 550b65f2..ca6559eb 100644 --- a/includes/i18n.php +++ b/includes/i18n.php @@ -41,6 +41,7 @@ class I18n 'icon_dir_failure' => "Couldn't open icon directory (%s). Skipping.\n", 'dir_create' => "Creating output directory.\n", 'dir_error' => "Couldn't create directories.\n", + 'gd_error' => "Error: GD functions seem to be missing, e.g. imagecreatefrompng(). Install them or recompile PHP with GD support, then try again.\n", 'dir_success' => "Dirs successfully created.\n", 'no_cli' => "We don't seem to be running via the command line. Keep in mind this tool was designed for command line usage, and hasn't been tested in other situations.\n", 'pngcrush_missing' => "pngcrush seems to be missing (path: %s). By default, it needs to be in the tools directory, chmodded to be executable, and at least version 1.7.60.\nImage will not be optimized by pngcrush.\n", diff --git a/pokesprite.php b/pokesprite.php index 9106099b..3ac261ef 100755 --- a/pokesprite.php +++ b/pokesprite.php @@ -105,6 +105,12 @@ I18n::set_default_lines(); $termfrm = new TerminalFormatter(); I18n::add_output_filter(array('PkSpr\TerminalFormatter', 'format')); +// Check if we have GD. +if (!function_exists('imagecreatefrompng')) { + print(I18n::l('gd_error')); + die(); +} + // Print basic program info. print(I18n::lf('info', array( $title_str,