Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.79k stars 1.5k forks source link

Is there a way to strip or clear exif data when encoding a file? #1344

Closed abishekrsrikaanth closed 2 months ago

abishekrsrikaanth commented 2 months ago

I am using the imagick driver. Is there a way to strip or clear exif data when encoding a file? I am trying to clear all exif data before saving the file to the Storage Driver.

olivervogel commented 2 months ago

This is not possible with the current range of features of this library. There is already an issue on this topic: https://github.com/Intervention/image/issues/1110

Until there is an official solution, I recommend implementing the function yourself with a custom modifier accessing the Imagick::class object directly.

abishekrsrikaanth commented 2 months ago

Will calling the stripImage() using the the core()->native() strip the metadata. I created a modifier to call this before encoding the file as below. Will this work?

public function apply(ImageInterface $image): ImageInterface
{
    $imagick = $image->core()->native();

    $imagick->stripImage();
}