S
S
Sergei Iamskoi2017-05-30 11:43:54
PHP
Sergei Iamskoi, 2017-05-30 11:43:54

Why is the exif file not saved?

When uploading images to the server, the server compresses them. It is logical that the exif file is lost. But using the tool getImageProperty and setImageProperty I'm trying to write exif to a new file. The function returns true - which means that the data was successfully written, but in fact it is empty. CHADNT?
The code I'm testing on:

$image = new \Imagick('IMAG0400.jpg');
        $exif = $image->getImageProperties();
        $image->thumbnailImage(600, 800);
        foreach($exif AS $prop => $value){
            Echo 'Set '.$prop.' => '.$value.': '.print_r($image->setImageProperty($prop, $value),1).PHP_EOL;
        }

        $image->writeImage('IMAG0400_CROP.jpg');
        $image = new Imagick('IMAG0400_CROP.jpg');
        print_r($image->getImageProperties());

Imagick version:
Imagick compiled with ImageMagick version => ImageMagick 6.8.9-9 Q16 x86_64 2016-11-26 www.imagemagick.org
Imagick using ImageMagick library version => ImageMagick 6.8.9-9 Q16 x86_64 2017-03-12 www. imagemagick.org

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2017-05-30
@syamskoy

quick googling gave the answer , in short - they can ONLY EDIT exif, he can't add properties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question