php - remove Exiff from UploadedFile Symfony
28
I have form that use to upload picture. I can't save this picture on my server, But I send it to another service ( external)
I have to encode base 64
my code is:
$base_img = base64_encode(file_get_contents($data["image"]));
where $data['image'] is UploadedFile
How can Remove all Exiff from $data['image'] before encode?
Answer
Solution:
Recently I needed exactly that and I achieved it with passing
$uploadedFile->getRealPath()
to the Imagick. Complete function:I took saving icc profile idea from comments here: https://www.php.net/manual/en/imagick.stripimage.php