48079[FEATURE] Preserve image rotation if orient is saved in exif
Commit message
Review
-
Code review CR +2
- Markus Klein +2
- Frans Saris +1
-
Verified V +2
- Markus Klein +2
- Frans Saris +1
- TYPO3com +1 CI
Issues 1
Files 4
Review log 6474
Show 4249 earlier messages
-
Stefan Froemken uploaded patch set 1 05/11/16, 14:03
-
Mathias Schreiber voted on patch set 1 CR +1 V +1 05/11/16, 14:49
-
Christian Kuhn commented on patch set 1 05/12/16, 09:20
feature. imho no-go for 7.6. -
Christian Kuhn updated the commit message in patch set 2 05/12/16, 09:21
-
Stefan Froemken commented on patch set 2 05/12/16, 10:31
I have declared it as a Task and not as a Feature. I think we should react on the new technical possibilities in the world outside. If a new version of browser breaks our backend I'm pretty sure we will deliver an update. A "That was fixed in 8" is not helpful for 7.6 users, which we will give support until April 2017 and maybe more. -
Tomita Militaru voted on patch set 2 CR +1 V +1 05/12/16, 21:05
-
Benni Mack commented on patch set 2 05/13/16, 05:23
Hey Stefan, no matter if we declare it as task or feature, we need a RST file for the new setting (so people know there is something new they can configure. Apart from that, the change seems fine. -
Frank Nägler commented on patch set 2 CR -1 05/13/16, 11:25
please add the new setting with proper values to the Presets. GM does not support the -auto-orient parameter (maybe there is an alternative?) but GM will fail with this CLI argument. If GM has an alternative, this should be implemented, else the preset should set the new setting to false. If GM has no alternative the code in GraphicalFunctions should check if GM is used to prevent broken installations. -
Frank Nägler commented on patch set 2 06/07/16, 15:08
@Stefan any news or plans for this patch? -
Frank Nägler commented on patch set 2 06/22/16, 20:43
auto-orient is supported since 2013, thx to Joerg for the hint. but the preset should be adjusted as mentioned. -
Jörg Bösche commented on patch set 2 06/22/16, 21:07
Tested on Ubuntu 16.04 LTS with GraphicsMagick 1.3.23 2015-11-07 Q16 from apt-package. Command: /usr/bin/gm convert exif.jpg -auto-orient oriented.jpg The output was rotated by respecting the exif parameter "Orientation (Tag-ID 0112)" without any errors. The parameter "-auto-orient" was introduced in 2013/10 with the release 1.3.18. Have a look at http://www.graphicsmagick.org/NEWS.html#march-10-2013 Also the documentation of graphicsmagick: http://www.graphicsmagick.org/GraphicsMagick.html (see "auto-orient") -
Frank Nägler commented on patch set 2 11/07/16, 14:32
no changes since four month, anyone who will make this patch ready? -
Benni Mack commented on patch set 2 09/20/17, 14:53
last ping before abandoning this change. needs a rebase and further review. -
Markus Klein commented on patch set 2 09/21/17, 06:52
This change still makes sense! iPhone, Samsung (and some others) are affected -
Benni Mack uploaded patch set 3 09/21/17, 08:08
-
TYPO3com voted on patch set 3 V +1 09/21/17, 08:22 Completed build in 13m 49s on Thu, 21 Sep, 10:22 AM Test Summary: 56763 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15091
-
Wouter Wolters voted on patch set 3 CR +1 09/21/17, 09:23
-
Markus Klein commented on patch set 3 CR -1 09/21/17, 21:38
@Froemken: Is this also compatible with GraphicsMagick? temporary -1 -
Markus Klein commented on patch set 3 CR +1 09/21/17, 21:39
Ah it is. -
Markus Klösges commented on patch set 3 V -1 09/22/17, 08:23
That works for non-resizing images, but as soon as I apply cropping to the image, the image is rendered without rotation again. I don't know the image-processing code by heart, therefore I can't provide an improved patch. -
Markus Klösges commented on patch set 3 V 0 09/22/17, 09:55
I just verified, that this works for resizing images with f:image, I think like that we made a big step forward, even if cropping with the editor does not work yet. What I found out so far without beeing able to make it work is that TYPO3\CMS\Core\Imaging\ImageManipulation\Area::makeAbsoluteBasedOnFile is computing the cropping in pixels from file metadata, that does not take the rotation into account and the changes proposed in https://forge.typo3.org/issues/69274#note-10 would allow to read the correct image size accounting for exif rotation -
Markus Sommer commented on patch set 3 CR +1 V +1 09/22/17, 13:19
Works perfect. in Frontend and in backend :) -
Markus Sommer commented on patch set 3 CR -1 V -1 09/22/17, 15:00
If you crop the image it will be faild -
Markus Sommer uploaded patch set 4 09/22/17, 15:14
-
Markus Sommer commented on patch set 4 09/22/17, 15:14
This will fix the crop problem -
TYPO3com voted on patch set 4 V +1 09/22/17, 15:28 Completed build in 14m 04s on Fri, 22 Sep, 05:28 PM Test Summary: 56763 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15122
-
Markus Klein commented on patch set 4 CR -1 09/22/17, 15:38
Instead of adding this parameter to all places where imagemagick is used, why don't we add it at a central place? -
Markus Klein uploaded patch set 5 09/22/17, 15:49
-
TYPO3com voted on patch set 5 V +1 09/22/17, 16:02 Completed build in 12m 56s on Fri, 22 Sep, 06:02 PM Test Summary: 56763 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15123
-
Markus Klösges commented on patch set 5 V -1 09/22/17, 17:01
Tested with Bootstrap-Package: That does resize images to the given size, but (probably) uses the non-rotated size as reference to compute the cropping. So images get stretched/squeezed in FE (width/height switched). -
Frans Saris commented on patch set 5 09/23/17, 06:01
Now it's enabled by default without option to disable it? Not sure if it breaks extensions like image_autoresize https://extensions.typo3.org/extension/image_autoresize/ -
Benni Mack commented on patch set 5 09/23/17, 11:59
yes. I wonder if we should rather add this logic when a new file was uploaded and not when it is rendered... -
Markus Klein commented on patch set 5 CR -1 09/24/17, 10:05
Rotation on upload sound good in general, but what to do with those images that are upload by other means like sftp? Or remote images? -
Georg Ringer commented on patch set 5 09/25/17, 19:39
the file could be rotate before writing the sys_file record? -
Markus Klösges commented on patch set 5 V 0 10/02/17, 19:45
Rotating jpgs is lossy, so I'm not sure if TYPO3 should modify the original image. The user will probably not expect such a thing to happen if he uploads files. -
Markus Klösges uploaded patch set 6 10/02/17, 21:21
-
TYPO3com voted on patch set 6 V -1 10/02/17, 21:22 Completed build in 08s on Mon, 2 Oct, 11:22 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15279
-
Markus Klösges commented on patch set 6 CR -1 V +1 10/02/17, 21:26
I was able to get the resizing, cropping and also the crop-gui in the backend producing the desired results. That work is based on the comment of Ruben Schmidmeister in the corresponding issue. Additionally I had to add the -auto-orient to the scalecmd. Otherwise the image will be resized to the wrong geometry before cropping. Clearly, that needs refactoring! But probably some of you have a clear understanding where that getExifAwareImageSize should go - I have just pasted it in because I don't know the surrounding code that much. -
Tomas Norre Mikkelsen commented on patch set 6 CR +1 11/30/17, 09:21
ImageInfo.php:58I would prefer having this in a Utility, as we have duplicate code with the sysext/core/Classes/Imaging/GraphicalFunctions.php -
Mathias Brodala commented on patch set 6 03/09/18, 13:53
Stefan can you rebase this to the latest master? -
Stefan Froemken uploaded patch set 7 03/14/18, 20:22
-
TYPO3com voted on patch set 7 V -1 03/14/18, 20:22 Completed build in 09s on Wed, 14 Mar, 09:22 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20946
-
Stefan Froemken uploaded patch set 8 03/14/18, 20:25
-
TYPO3com voted on patch set 8 V -1 03/14/18, 20:26 Completed build in 10s on Wed, 14 Mar, 09:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20947
-
Stefan Froemken uploaded patch set 9 03/14/18, 20:27
-
TYPO3com voted on patch set 9 V +1 03/14/18, 20:36 Completed build in 08m 14s on Wed, 14 Mar, 09:36 PM Test Summary: 30876 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20948
-
Josef Glatz commented on patch set 9 03/14/18, 23:33
General question: Is the behaviour different for existing images after an upgrade from e.g. 8.7 to 9LTS? -
Frans Saris commented on patch set 9 03/15/18, 07:11
Josif this is used when resizing a file. Difference between 8lts and 9 will be that after re-processing a scaled image the orientation is correct. It doesn't touch the original fileGraphicalFunctions.php:2172UnresolvedUse FileInfo object here to reduce duplicate code -
Frans Saris commented on patch set 9 03/15/18, 07:17
ImageInfo.php:75Are these the only possible options to determine the orientation? See https://github.com/xperseguers/t3ext-image_autoresize/blob/b25d62c5fb653275da971479607e71d81d6cb626/Classes/Utility/ImageUtility.php#L257 Here everything above 1 is rotated
-
Frank Nägler commented on patch set 9 CR -1 03/15/18, 09:30
In general a nice patch and I would like to have it in the core, but we have to ensure, that this feature (not a TASK btw, rst file required) will not break existing installations on a migration to v9. The auto-rotation feature is enabled by default (now), this means that after an upgrade a lot of images could be rotated where it is not intended. Imho we need two things: 1) enable/disable the flag in image settings 2) enable/disable the flag per image? (not sure yet, but I think this would be nice) -
Markus Klein commented on patch set 9 03/15/18, 10:34
> 2) enable/disable the flag per image? (not sure yet, but I think this would be nice) I disagree on that. Any proper photo software always rotates images properly. Why I think this is no problem for updates: Consider having uploaded an image, which is not rotated properly in the image data, but has EXIF orientation set. Till now this could have two outcomes: If the raw image is sent to the browser, some browser rotate the image automatically. If the image is processed the image would have wrong orientation in the browser and the editor would have noticed. (even one of our non-advanced editors noticed, when uploading a photo from his Samsung mobile) Having an image with conflicting orientation info that is now displayed correctly in FE (after EXIF has been removed due to processing) is unlikely, because in such a situation the image will have a wrong orientation when the source file is viewed with an arbitrary image software on a mobile or on desktop. Instead of adding a switch to control the auto-orientation feature, I would rather add an image rotation button for the editor, to be able to correct the orientation of an image (and wipe away the EXIF data). -
Markus Klösges commented on patch set 9 03/15/18, 12:11
Regarding the upgrade path: I agree, that changing the behaviour here should not be critical for updates, as the current state is "EXIF-Images are displayed wrong if processed, or the browser will rotate them". After applying this change, it will be displayed correctly in every case. There is no regression risk as far as I see. On the other hand, if I remember correctly from testing back in September, the image width/height is persisted in the database somehow. That resulted in already uploaded images with exif-data on them that where previously shown in frontend having wrong info in that table, leading to corrupted FE-Output then. So the major problem is the wrong metadata in the DB. I will try to verify this behaviour again to be sure. +1 for an Image-Rotation button in imagemanip, but that is another FEATURE I would say. -
Markus Klösges commented on patch set 9 V +1 03/15/18, 13:25
I can confirm: Images already uploaded, that have EXIF-rotation set, will NOT be correctly rotated by just applying this patch. Images with EXIF-rotation set that are added to fileadmin after applying this patch will be correctly rotated. I tested that by putting a copy of the same file into fileadmin after applying the patch - so its not related to the file itself. deleting fileadmin/_processed_/* fixes also the already uploaded images. But the info in sys_file_metadata.width/height will not be updated to reflect the correct width/height respecting exif-rotation. I don't know what implications that has. For images uploaded after the patch, those infos are correct. -
Markus Klösges commented on patch set 9 03/15/18, 15:13
ImageInfo.php:75Reply UnresolvedWe need to reflect all cases here that change image-sizes. that would be all >= 5. Those currently used here are probably those used by most cameras. But to be correct all >=5 need to be considered here. for reference, and testing: https://github.com/recurser/exif-orientation-examples -
Frank Nägler commented on patch set 9 CR 0 03/15/18, 15:19
thx for investigations and explanations. I remove my -1 -
Tobi Kretschmann voted on patch set 9 CR +1 03/19/18, 08:30
-
Frank Nägler commented on patch set 9 05/09/18, 11:41
ping, this patch needs a rebase and has some comments. -
Frans Saris uploaded patch set 10 05/16/18, 19:47
-
Frans Saris voted on patch set 10 V +1 CR +1 05/16/18, 19:47
-
TYPO3com voted on patch set 10 V +1 05/16/18, 19:53 Completed build in 06m 49s on Wed, 16 May, 09:53 PM Test Summary: 31187 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23581
-
Tymoteusz Motylewski commented on patch set 10 CR -1 05/16/18, 20:03
Please mark it as a feature and provide proper rst with info on how and when will it influence users. -
Frans Saris uploaded patch set 11 05/16/18, 20:23
-
Frans Saris voted on patch set 11 V +1 CR +1 05/16/18, 20:23
-
TYPO3com voted on patch set 11 V +1 05/16/18, 20:31 Completed build in 08m 07s on Wed, 16 May, 10:31 PM Test Summary: 31187 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23582
-
Markus Klein commented on patch set 11 CR -1 05/18/18, 13:33
GraphicalFunctions.php:204space missing hereImageInfo.php:61data type -
Markus Klein commented on patch set 12 05/18/18, 13:38
Published edit on patch set 11. -
Markus Klein voted on patch set 12 CR +1 05/18/18, 13:39
-
TYPO3com voted on patch set 12 V +1 05/18/18, 13:46 Completed build in 07m 06s on Fri, 18 May, 03:46 PM Test Summary: 31241 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23660
-
Markus Klein commented on patch set 12 05/18/18, 13:46
I added a test image to forge -
Frans Saris voted on patch set 12 V +1 CR +1 05/18/18, 14:04
-
Markus Klein commented on patch set 12 V +1 05/18/18, 14:06
lovely, works also with cropping and so on. -
Markus Klein voted on patch set 12 V +2 CR +2 05/18/18, 14:06
-
Markus Klein merged patch set 13 05/18/18, 14:06
-
Christian Richter commented on patch set 13 11/19/18, 10:13
Very sorry, noob here! Can this be backported to TYPO3_8-7? I tried to aplly the changes on the current 8.7 master, but gerrit will not accept my push: remote: Resolving deltas: 100% (13/13) remote: Branch refs/heads/TYPO3_8-7: remote: You are not allowed to perform this operation. remote: To push into this reference you need 'Push' rights. remote: User: christian.richter remote: Please read the documentation and contact an administrator remote: if you feel the configuration is incorrect remote: Processing changes: refs: 1, done To ssh://review.typo3.org:29418/Packages/TYPO3.CMS.git ! [remote rejected] TYPO3_8-7 -> TYPO3_8-7 (prohibited by Gerrit: ref update access denied) error: failed to push some refs to 'ssh://christian.richter@review.typo3.org:29418/Packages/TYPO3.CMS.git'