mirror of
https://github.com/Intervention/image.git
synced 2025-08-21 05:01:20 +02:00
Merge branch 'develop' into feature/blending-color
This commit is contained in:
@@ -60,12 +60,12 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
||||
|
||||
// fix image orientation
|
||||
return match ($image->exif('IFD0.Orientation')) {
|
||||
2 => $image->flip(),
|
||||
2 => $image->flop(),
|
||||
3 => $image->rotate(180),
|
||||
4 => $image->rotate(180)->flip(),
|
||||
5 => $image->rotate(270)->flip(),
|
||||
4 => $image->rotate(180)->flop(),
|
||||
5 => $image->rotate(270)->flop(),
|
||||
6 => $image->rotate(270),
|
||||
7 => $image->rotate(90)->flip(),
|
||||
7 => $image->rotate(90)->flop(),
|
||||
8 => $image->rotate(90),
|
||||
default => $image
|
||||
};
|
||||
|
@@ -33,15 +33,34 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
||||
|
||||
// fix image orientation
|
||||
switch ($imagick->getImageOrientation()) {
|
||||
case Imagick::ORIENTATION_BOTTOMRIGHT:
|
||||
case Imagick::ORIENTATION_TOPRIGHT: // 2
|
||||
$imagick->flopImage();
|
||||
break;
|
||||
|
||||
case Imagick::ORIENTATION_BOTTOMRIGHT: // 3
|
||||
$imagick->rotateimage("#000", 180);
|
||||
break;
|
||||
|
||||
case Imagick::ORIENTATION_RIGHTTOP:
|
||||
$imagick->rotateimage("#000", 90);
|
||||
case Imagick::ORIENTATION_BOTTOMLEFT: // 4
|
||||
$imagick->rotateimage("#000", 180);
|
||||
$imagick->flopImage();
|
||||
break;
|
||||
|
||||
case Imagick::ORIENTATION_LEFTBOTTOM:
|
||||
case Imagick::ORIENTATION_LEFTTOP: // 5
|
||||
$imagick->rotateimage("#000", -270);
|
||||
$imagick->flopImage();
|
||||
break;
|
||||
|
||||
case Imagick::ORIENTATION_RIGHTTOP: // 6
|
||||
$imagick->rotateimage("#000", -270);
|
||||
break;
|
||||
|
||||
case Imagick::ORIENTATION_RIGHTBOTTOM: // 7
|
||||
$imagick->rotateimage("#000", -90);
|
||||
$imagick->flopImage();
|
||||
break;
|
||||
|
||||
case Imagick::ORIENTATION_LEFTBOTTOM: // 8
|
||||
$imagick->rotateimage("#000", -90);
|
||||
break;
|
||||
}
|
||||
|
@@ -29,6 +29,11 @@ class FontFactory
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function file(string $value): self
|
||||
{
|
||||
return $this->filename($value);
|
||||
}
|
||||
|
||||
public function color(mixed $value): self
|
||||
{
|
||||
$this->font->setColor($value);
|
||||
|
Reference in New Issue
Block a user