- Issue created by @adamps
- Status changed to Needs review
4 months ago 8:13pm 18 December 2024 - πΊπΈUnited States msielski
Found this issue via issue #3401578. I'm not able to use the solution here because of the change from using hook_file_presave to only using a form alter. In my use case, images are created via another module (media_acquiadam, but I imagine any situation where images come in via an API would be affected), so the form alter approach gets skipped while the the hook_file_presave approach would work.
- π·π΄Romania alex.stanciu
Here's a patch for this MR which adds support for the imagick toolkit, if you find it useful.
- π¬π§United Kingdom adamps
@msielski Yes you are right, good point.
@staalex Thanks
- Status changed to Needs work
14 days ago 6:49pm 11 April 2025 - First commit to issue fork.
- Merge request !1Added hook_file_presave() for applying orientation to the file in cases not... β (Open) created by greenskin
- πΊπΈUnited States greenskin
Made a merge request into the 3477919-overall-combined-fix branch that adds the `hook_file_presave()` hook back in (applies orientation changes in cases where the upload validation isn't applicable), and fixes an issue where the orientation value doesn't get removed for orientations other than 5, 6, 7, and 8.
See 3477919-overall_combined_fix-tweaks - First commit to issue fork.
- π«π·France tostinni
@greenskin, adding back the
exif_orientation_file_presave()
fixed a bug that we had where the exif rotation wasn't working when adding an image through the media library, so I'm adding this in the main MR.For the other part regarding fixing "the orientation value doesn't get removed for orientations" can you describe how to test it ?
I haven't added it for the moment, and if it's needed then we should also patch the GD part insrc/Plugin/ImageToolkit/Operation/gd/AutoOrient.php
@adamps I imagine this part should be written as annotations ?
#[ImageToolkitOperation( id: 'exif_orientation_gd_auto_orient', toolkit: 'gd', operation: 'auto_orient', label: new TranslatableMarkup('Auto orient image'), description: new TranslatableMarkup('Automatically adjusts the orientation of an image.'), )]