0

After upgrade to 1.94 I realized that image upload is removing all Exif data from uploaded images. I tried to search for any '->stripImage()' string in the project but no success.

1
  • explain in detail Commented Jun 11, 2019 at 21:53

1 Answer 1

0

The reason Magento strips metadata is because it poses a security risk, so I would highly recommend against disabling it, but I'll still explain below how you would do it.

How to disable image reprocessing

Instead of just removing EXIF data, as of Magento 1.9.3.3 it rebuilds the entire image into a new file. The logic for this can be found within the following function \Mage_Core_Model_File_Validator_Image::validate

As of Magento 1.9.3.6 you will also notice in the validate function there is an early return statement that checks general/reprocess_images/active.

You can set this to a falsely value through an XML config file, which would remove this additional security measure.

Additional Note

If you really wanted to have the metadata on the new image, I would recommend extending the validate function. Reading the meta data from the old file with exif_read_data, applying some manual processing/sanitization on the results and setting it on the new image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.