];
// Systems using non-bundled GD2 don't have imagerotate. Test if available.
- if (function_exists('imagerotate')) {
+ // @todo Remove the version check once
+ // https://www.drupal.org/project/drupal/issues/2670966 is resolved.
+ if (function_exists('imagerotate') && (version_compare(phpversion(), '7.0.26') < 0)) {
$operations += [
'rotate_5' => [
'function' => 'rotate',
- 'arguments' => ['degrees' => 5, 'background' => '#FF00FF'], // Fuchsia background.
+ // Fuchsia background.
+ 'arguments' => ['degrees' => 5, 'background' => '#FF00FF'],
'width' => 41,
'height' => 23,
'corners' => array_fill(0, 4, $this->fuchsia),
],
'rotate_90' => [
'function' => 'rotate',
- 'arguments' => ['degrees' => 90, 'background' => '#FF00FF'], // Fuchsia background.
+ // Fuchsia background.
+ 'arguments' => ['degrees' => 90, 'background' => '#FF00FF'],
'width' => 20,
'height' => 40,
'corners' => [$this->transparent, $this->red, $this->green, $this->blue],
if ($image->getToolkit()->getType() == $image_original_type || $corner != $this->transparent) {
$correct_colors = $this->colorsAreEqual($color, $corner);
$this->assertTrue($correct_colors, SafeMarkup::format('Image %file object after %action action has the correct color placement at corner %corner.',
- ['%file' => $file, '%action' => $op, '%corner' => $key]));
+ ['%file' => $file, '%action' => $op, '%corner' => $key]));
}
}
}
$image = $this->imageFactory->get();
$image->createNew(50, 20, image_type_to_extension($type, FALSE), '#ffff00');
$file = 'from_null' . image_type_to_extension($type);
- $file_path = $directory . '/' . $file ;
+ $file_path = $directory . '/' . $file;
$this->assertEqual(50, $image->getWidth(), SafeMarkup::format('Image file %file has the correct width.', ['%file' => $file]));
$this->assertEqual(20, $image->getHeight(), SafeMarkup::format('Image file %file has the correct height.', ['%file' => $file]));
$this->assertEqual(image_type_to_mime_type($type), $image->getMimeType(), SafeMarkup::format('Image file %file has the correct MIME type.', ['%file' => $file]));
// Color at top-right pixel should be fully transparent while in memory,
// fully opaque after flushing image to file.
$file = 'image-test-no-transparent-color-set.gif';
- $file_path = $directory . '/' . $file ;
+ $file_path = $directory . '/' . $file;
// Create image.
$image = $this->imageFactory->get();
$image->createNew(50, 20, 'gif', NULL);