Description
Hi,
Glide uses Intervention/Image internally to process images, which itself relies on either GD or Imagick.
I noticed an inconsistency in EXIF metadata handling depending on the driver used.
Current behavior
- GD (via Intervention/Image)
EXIF metadata are always stripped, with no way to keep them.
- Imagick (via Intervention/Image)
- If the strip option is not provided, all EXIF metadata are preserved
- If strip = true, Intervention/Image removes EXIF metadata while keeping color profiles
This means that simply switching the driver from GD to Imagick can unexpectedly reintroduce EXIF metadata.
Problem
Glide currently does not expose or forward the strip parameter to Intervention/Image.
As a result, users cannot explicitly request EXIF stripping when using the Imagick driver, even though Intervention/Image already supports this behavior.
Expected / suggested behavior
Glide should allow passing a strip parameter to Intervention/Image so users can control metadata handling consistently across drivers.
This would:
- Enable EXIF stripping with Imagick
- Preserve color profiles when stripping metadata
- Reduce behavioral differences between GD and Imagick
Proposed implementation
Intervention/Image already supports a strip option for Imagick encoders.
Glide only needs to forward the strip parameter from request parameters to the encoder options.
In src/Api/Encoder.php, inside the run() method, Glide could map the request parameter to Intervention/Image:
if ($this->params['strip'] ?? false) {
$encoderOptions['strip'] = true;
}
This does not add new image-processing logic to Glide; it simply exposes an existing Intervention/Image feature.
Related note
More generally, I think it could also make sense to open a PR on Intervention/Image itself to further uniformize the default behavior between GD and Imagick, so metadata handling is consistent regardless of the underlying driver (cf Intervention/image#1471).
I’d be happy to open a PR if this change sounds acceptable 🙂
Thanks for your work on Glide!
Description
Hi,
Glide uses Intervention/Image internally to process images, which itself relies on either GD or Imagick.
I noticed an inconsistency in EXIF metadata handling depending on the driver used.
Current behavior
EXIF metadata are always stripped, with no way to keep them.
This means that simply switching the driver from GD to Imagick can unexpectedly reintroduce EXIF metadata.
Problem
Glide currently does not expose or forward the
stripparameter to Intervention/Image.As a result, users cannot explicitly request EXIF stripping when using the Imagick driver, even though Intervention/Image already supports this behavior.
Expected / suggested behavior
Glide should allow passing a strip parameter to Intervention/Image so users can control metadata handling consistently across drivers.
This would:
Proposed implementation
Intervention/Image already supports a
stripoption for Imagick encoders.Glide only needs to forward the strip parameter from request parameters to the encoder options.
In
src/Api/Encoder.php, inside therun()method, Glide could map the request parameter to Intervention/Image:This does not add new image-processing logic to Glide; it simply exposes an existing Intervention/Image feature.
Related note
More generally, I think it could also make sense to open a PR on Intervention/Image itself to further uniformize the default behavior between GD and Imagick, so metadata handling is consistent regardless of the underlying driver (cf Intervention/image#1471).
I’d be happy to open a PR if this change sounds acceptable 🙂
Thanks for your work on Glide!