I have a resizing function that does it's primary job right, but doesn't save
the exif data that comes with the original image file. Everything seems to be
correct until I call ->writeImage();
function, which seems to strip the exif
data of the image.
$resizeimage= new Imagick($image);
$exifDataArray = $resizeimage->getImageProperties("exif:*");
$resizeimage->thumbnailImage($width,$height);
$resizeimage->setImageCompression(imagick::COMPRESSION_JPEG);
$resizeimage->setImageCompressionQuality(90);
echo $resizeimage->setImageProperty('Exif:Make', 'BLABLABLA');
$resizeimage->writeImage();
$updated= new Imagick($image);
echo $updated->getImageProperty('Exif:Make');
Note that If I print_r($exifDataArray);
it shows the exif data
To make a change I put 'Exif:Make', 'BLABLABLA' and see if the
new exif data is written on the image, and it is written correctly
but after I resizeimage->writeImage();
No more exif data is present on the image file.
Can anybody help? Is there any way to keep the exif data on the image?
It seems the error isn't there for the first time.
A workaround I use at the moment:
exiftool -overwrite_original_in_place -tagsFromFile $source_file $converted_file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With