Please note that striping off the exif information without handling the orientation information available in the exif will lead to wrong orientation of the image
(PECL imagick 2, PECL imagick 3)
Imagick::stripImage — Supprime d'une image tous les profiles et les commentaires
Supprime d'une image tous les profiles et les commentaires.
Cette fonction ne contient aucun paramètre.
Retourne true
en cas de succès.
Lance une exception ImagickException si une erreur survient.
Please note that striping off the exif information without handling the orientation information available in the exif will lead to wrong orientation of the image
StripImage also delete ICC image profile by default.
The resulting images seem to lose a lot of color information and look "flat" compared to their non-stripped versions.
Consider keeping the ICC profile (which causes richer colors) while removing all other EXIF data:
1. Extract the ICC profile
2. Strip EXIF data and image profile
3. Add the ICC profile back
The code is:
<?php
$profiles = $img->getImageProfiles("icc", true);
$img->stripImage();
if(!empty($profiles))
$img->profileImage("icc", $profiles['icc']);
?>