Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

EXIF Removal

Security covered Under active development 70 sites

Part of the Exif ecosystem · 4 projects

This module automatically removes sensitive metadata, such as GPS location and device information, from uploaded images to protect user privacy. It works in the background during file uploads, stripping EXIF data using GD or ImageMagick.

EXIF Removal is a privacy-focused Drupal module that automatically strips sensitive metadata from uploaded images. It protects user privacy by removing GPS locations, device information, and timestamps that could potentially expose personal information.

The module works silently in the background during the file upload process. When users upload images through any Drupal form (content creation, user pictures, media library, etc.), the module intercepts the upload, processes the image to remove sensitive metadata, and then allows the upload to complete normally.

It uses GD and imagejpeg() to create a new copy of the image, imagejpeg() will reencode the image, we use the quality value 80 because the comment from PHP page https://www.php.net/manual/en/function.imagejpeg.php#76780

I did an experiment with the image quality parameter of the imagejpeg() function when creating jpegs. I found the optimal image quality with file size is taken into account to be 80 - very close to the default value of 75.

Anything over 80 results in an unnecessary increase in file size without much increase in image quality.

      // Remove all EXIF data from the image.
      if ($file->getMimeType() == 'image/jpeg') {
        // Use GD to strip all EXIF data by re-saving the image.
        $image_resource = @imagecreatefromjpeg($path);
        if (!$image_resource) {
          // Failed to create image resource.
          return FALSE;
        }

        // Create a new image without EXIF data.
        imagejpeg($image_resource, $path, 80);
        imagedestroy($image_resource);

        return TRUE;
      }

It also supports imagemagick if image_effects is installed.

      $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();
        }
      }
Drupal 10–11

Ask your assistant about EXIF Removal

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Mar 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 6
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0 Stable 10–11 Mar 26, 2025
1.0.0-beta4 Pre-release 10–11 Mar 18, 2025
1.0.0-beta3 Pre-release 10–11 Mar 13, 2025
1.0.0-beta2 Pre-release 10–11 Mar 13, 2025
1.0.0-beta1 Pre-release 10 Mar 12, 2025
1.0.x-dev Dev 10–11 Mar 12, 2025