스테이플러의 자동 회전 기능에 약간의 불일치가 생겨서 어떤 일이 일어날 지 설명 할 수 있기를 바랍니다.PHP 스테이플러 및 이미지 자동 작성 문제
내 스타일은 설득력 모델에 다음과 같이 정의된다 :
'styles' => [
'thumbnail' => [
'dimensions' => '300',
'auto_orient' => true,
'convert_options' => ['quality' => 100],
],
'standard' => [
'dimensions' => 'x275',
'auto_orient' => true,
'convert_options' => ['quality' => 100],
],
'zoom' => function($file, $imagine) {
$image = $imagine
->setMetadataReader(new \Imagine\Image\Metadata\ExifMetadataReader)
->open($file->getRealPath());
// Auto rotate the image
$filter = new \Imagine\Filter\Basic\Autorotate;
$filter->apply($image);
// Get the current size
$size = $image->getSize();
// Scale down to zoom size only if
// image is wide enough.
if ($size->getWidth() > 1280) {
$newSize = $size->widen(1280);
$image->resize($newSize);
}
return $image;
}
]
문제는 특정 이미지를 들어, zoom
스타일이 제대로 작동하지 않는 것입니다. 원고가 이미 똑바로 있더라도 90도 회전시킵니다.
여기 원본 이미지의 스크린 샷, 당신은 그것을 똑바로입니다 볼 수 있습니다
다음은 zoom
스타일에 의해 처리 된 후 이미지의 스크린 샷입니다. 그것은 90도 회전 : 당신이 볼 수 있듯이
, 나는 또한 thumbnail
및 standard
스타일을 true로 autorotate
세트를 가지고,하지만 그 이미지는 90도 회전 처리 후 제대로 표시되지 않습니다.
이상한 점은 원본 이미지의 exif 방향 데이터를 검사 할 때 값이 6이므로 이미지가 90도 회전해야한다는 것입니다. 그렇다면 왜 다른 스타일도 회전하지 않습니까?
$imagine = new Imagine\Imagick\Imagine;
$image = $imagine->open('https://s3.amazonaws.com/path/to/original/image.jpg');
echo $image->metadata()->toArray()['ifd0.Orientation'];
// Output is 6
그래서이 이미지가 이미 직각이면 exif 방향이 6 인 이유가 궁금합니다. 또한 이미지가 zoom
스타일로만 회전되는 이유는 무엇입니까?