PHPKonf Istanbul PHP Conference 2019 - Call for Papers


(PECL imagick 2.0.0)

Imagick::stripImageSupprime d'une image tous les profiles et les commentaires


bool Imagick::stripImage ( void )

Supprime d'une image tous les profiles et les commentaires.

Valeurs de retour

Retourne TRUE en cas de succès.

Erreurs / Exceptions

Lance une exception ImagickException si une erreur survient.

add a note add a note

User Contributed Notes 3 notes

g dot a dot karthikeyan at gmail dot com
4 years ago
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
Max Eremin
1 year ago
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:
= $img->getImageProfiles("icc", true);


$img->profileImage("icc", $profiles['icc']);
7 years ago
this will actually clear exif data so if you run an image uploading script with privacy concerns, this will effectively clear all GPS / metadata from the image.
To Top