Problem/Motivation

From the comment https://www.drupal.org/project/exif_orientation/issues/2895434#comment-1...
We see that Imagick tool support strip exif.

$img = new Imagick($path);
$img->stripImage();
$img->writeImage($path);
$image->save();

Proposed resolution

Use image magic if exists to strip exif data to avoid override bitmap on image and see if there are no changes on the resolution.

Example based on MR https://git.drupalcode.org/project/exif_orientation/-/merge_requests/15/...


      $image = $this->imageFactory->get($file->getFileUri());
      if ($this->moduleHandler->moduleExists('image_effects')
        && $image->getToolkit()->getPluginId() == 'imagemagick') {
        $toolkit = $image->getToolkit();
        if ($toolkit->apply('strip')) {
          $image->save();
        }
      }
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eduardo morales alberti’s picture

eduardo morales alberti’s picture

Tested on Drupal 10.4.x Drupal with imageMagick, ready

eduardo morales alberti’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.