function drush_image_derive_validate

8.0.x image.drush.inc drush_image_derive_validate($style_name, $source)
7.x image.drush.inc drush_image_derive_validate($style_name, $source)
master image.drush.inc drush_image_derive_validate($style_name, $source)

File

commands/core/image.drush.inc, line 107
Image module's drush integration.

Code

function drush_image_derive_validate($style_name, $source) {
  drush_include_engine('drupal', 'image');
  if (!$style = drush_image_style_load($style_name)) {
    return drush_set_error(dt('Image style !style not recognized.', array('!style' => $style_name)));
  }

  if (!file_exists($source)) {
    return drush_set_error(dt('Source file not found - !file.', array('!file' => $source)));
  }
}