I'd like to optimize jpg image size by deleting exif metadata from it. I use Imagick and Imagine libraries to achieve this goal:
$image = $this->imagine->open($currentImagePath);
$iccProfile = $image->palette()->profile();
$image->strip();
$image->profile($iccProfile);
$image->save($optimizedImagePath);
But it doesn't work properly, it actually deletes all metadata from image including icc. Is there a way to delete just exif from jpg image using Imagine and Imagick?