Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic or manual rotation of the image according to EXIF orientation #1285

Open
olivervogel opened this issue Jan 28, 2024 · 3 comments
Open
Assignees
Milestone

Comments

@olivervogel
Copy link
Member

olivervogel commented Jan 28, 2024

Images can contain EXIF information for camera rotation. This information is read by Intervention Image and an alignment (rotation) is performed based on it. Since version 3 this happens automatically when new image instances are decoded. In version 2, the orientation had to be triggered manually using the orientate() method.

While this may seem convenient, it may not always be desirable. Especially for very large image formats, rotation can consume alot of memory and processing time, which is not always utilized. See #1278

A return to manual auto-alignment after EXIF camera rotation should be discussed.

Keep in mind that a return to manual, will be a breaking change.

What do you think?

@a-shafaat
Copy link

a-shafaat commented Jan 28, 2024

I'm not very familiar with the internal codes of Intervention Image, but I think if you use a flag/option variable with a correct default value, you can keep current behavior and avoid breaking change. something like this:

$image = $manager->read($filePath, FilePathImageDecoder::class, false)
read(mixed $input, string|array|DecoderInterface $decoders = [], bool $autoExifRotate = true)
OR
$image = $manager->read($filePath, FilePathImageDecoder::class, ['autoExifRotate' => false])
read(mixed $input, string|array|DecoderInterface $decoders = [], array $options= ['autoExifRotate' => true])

@Elycin
Copy link

Elycin commented Jan 30, 2024

+1 for this.

@sitenzo
Copy link

sitenzo commented May 5, 2024

Any updates on this, would love to have not autorotate my images.

@olivervogel olivervogel self-assigned this May 10, 2024
@olivervogel olivervogel added this to the 3.7.0 milestone May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants