0

I let users upload images to fileadmin when they're logged in in the frontend.

So far so good, this works.

Now some images (especially when uploaded form mobile phones) are rotated (if taken in landscape mode, for example). I tried using Imagick to autorotate those images upon upload, but it seems at least the IPhone doesn't have proper EXIF-data in the image (images taken in HEIC-Format, seem to be converted to jpgs when uploaded and then lose all EXIF-Data). At least the getImageOrientation-method from Imagick returns an invalid orientation.

Now, to overcome this, I've created a function for the users so they can rotate their images themselves. This works as well. The original image gets rotated as expected.

BUT: I need to update the processed images as well, since they still reflect the unrotated image.

How would I do that without manually deleting the processed-files in the installer?

I mean, I could create a new image and delete the old one, but that seems like some unnecessary labor.

Any ideas?

JKD
  • 1,279
  • 1
  • 6
  • 26
Swissdude
  • 3,486
  • 3
  • 35
  • 68
  • You could check what TYPO3 does upon cache clear and whether you can use some of the methods and adapt it to your needs. Meaning only the desired picture. You probably also need to clear the cache page if it's referring to the old processed image. – Alexander Aug 29 '20 at 21:07
  • 1
    Thanks - sounds equally cumbersome, though :) I guess I'll go with my original idea and just delete the unrotated picture and create a new one. – Swissdude Aug 29 '20 at 21:30
  • instead of inspecting all cache clearing, you might inspect what TYPO3 is doing if you replace one file (in the file list module) – Bernd Wilke πφ Aug 31 '20 at 05:47

0 Answers0