Review main Merged

30610[BUGFIX] Gifbuilder: Fix image-mask-functionality

Stefan Neufeind CR +2 V +2 Normal +109 −80 updated 06/28/14, 18:57

Commit message

Mask-functionality is broken since the
introduction of FAL.

Review

  • Code review CR +2
    • Markus Klein +2
    • Andreas Wolf +1
  • Verified V +2
    • Markus Klein +2
    • Andreas Wolf +1

Issues 1

Files 6

Review log 26

Show 1 earlier messages
  1. Stefan Neufeind commented on patch set 1 06/06/14, 14:18

    How come mask-functionality is completely broken currently? Or is it just me who's on the wrong track? :-) Works for me with this fix. Would be great to get some feedback from people like Andreas who worked on the Helper when FAL was introduced or from Olly who afaik also worked in the Mask-area in the past already.
    If we know *how* this broke, then let's adjust the Releases-line. Maybe just fix this for 6.2 anyway?

    LocalCropScaleMaskHelper.php:114

    What is this supposed to be? an is_object-check? If $maskBottomImage is not set or a string this would result in an error as is currently, as an object imho it would always be true.

    LocalCropScaleMaskHelper.php:144

    The image is created but not returned without this line. How come that "slipped through" or worked in the past?

    ContentObjectRenderer.php:5227

    remove newline

    ContentObjectRenderer.php:5283

    Copying this over seems to be the only logical way imho. LocalCropScaleMaskHelper expects file-objects under those names - and only if such objects exist it will work on the mask as it is supposed to do.
  1. Stefan Neufeind commented on patch set 1 06/06/14, 14:21

    I'll add code to test this with on forge in a second ...
  2. Frans Saris commented on patch set 1 06/06/14, 15:21

    LocalCropScaleMaskHelper.php:114

    I do not think this has anything to do with the mask problems. If you remove line 114 - 119 and 132 - 141 the mask still works. In TYPO3 4.7 this check was: $m_bottomImg = $maskImages['m_bottomImg']; if ($m_bottomImg) { $m_bottomImg_mask = $maskImages['m_bottomImg_mask']; } They changed the configurations names but only part of them. See also my comment in ContentObjectRenderer.php

    LocalCropScaleMaskHelper.php:115

    So this should be: if ($maskBottomImage instanceof Resource\FileInterface) { }

    ContentObjectRenderer.php:5283 Reply

    Only these lines are needed to get the watermark working. But I'm not sure yet if we need to fix this here or in the localCropScaleMaskHelper
  3. Stefan Neufeind uploaded patch set 2 06/08/14, 19:50

  4. Stefan Neufeind commented on patch set 2 06/08/14, 20:10

    Discussed with Andreas that the processing-code must have been there (and worked fine) before the arrival of FAL. So it broke sometime back in 6.0 :-) Removed 6.0 from the releases-line since imho this fix is not "critical" (it simply never worked in 6.0). Agreed with Andreas that we should adjust the config in ContentObjectRenderer (as done now) so the Helper does not need to know about FAL-internals (ProcessedFile). Added same adjustment for the bottom-image was there for the mask in patchset 1. I didn't test bottom-image (!) but the mask-thing works fine here for me.
  5. Markus Klein commented on patch set 2 06/08/14, 20:36

    LocalCropScaleMaskHelper.php:57

    Maybe document the structure of the returned array here.
  6. Stefan Neufeind commented on patch set 2 06/09/14, 09:14

    LocalCropScaleMaskHelper.php:57 Reply

    okay, todo. Either NULL or an array with (width, height, filePath) hmm, or numeric indizes it seems? $result = $tempFileInfo *sigh* or whatever $gifBuilder->imageMagickConvert will return - which, according to the phpdoc there, is: @return array [0]/[1] is w/h, [2] is file extension and [3] is the filename.
  7. Stefan Neufeind commented on patch set 2 06/09/14, 09:15

    @Andreas: Should the LocalCropScaleMaskHelper maybe always return numeric indizes, like imageMagickConvert does? I don't think we can invent our own speaking indizes here (though it would be nice).
  8. Markus Klein commented on patch set 2 06/19/14, 20:10

    Don't wait for Andreas, he never responds.
    now with 6.3
  9. Stefan Neufeind commented on patch set 2 06/19/14, 22:07

    Somebody please take care and let's get going :-(
  10. Markus Klein uploaded patch set 3 06/20/14, 01:37

  11. Markus Klein uploaded patch set 4 06/20/14, 01:51

  12. Mr. Jenkins commented on patch set 3 06/20/14, 01:51

  13. Markus Klein voted on patch set 4 V +1 CR +1 06/20/14, 01:52

  14. Mr. Jenkins commented on patch set 4 06/20/14, 02:06

  15. Stefan Neufeind commented on patch set 4 06/20/14, 07:52

    ContentObjectRenderer.php:1283

    Must be $info[3] I guess?
  16. Stefan Neufeind commented on patch set 4 06/20/14, 08:20

    Andreas said he'll have a closed look shortly. We agreed that it might make sense to separate the original fix from some cleanups done here, to have the fix itself more clear/visible.

    LocalCropScaleMaskHelper.php:133

    give those temporary parts also meaningful keys (discussed with Andreas Wolf)
  17. Markus Klein commented on patch set 4 06/20/14, 10:51

    ContentObjectRenderer.php:1283 Reply

    should be, but PHP handles numbers automatically for arrays. '3' will always be treated as 3, since you can't use stringified numbers as array index.
  18. Markus Klein commented on patch set 4 06/20/14, 10:52

    I just did the minimum cleanups to be consistent and to have valid return values. Please do stuff like renaming of intermediate array keys in a separate patch and keep this as it is. Thx.
  19. Stefan Neufeind commented on patch set 4 06/25/14, 07:13

    Haven't heard from Andreas yet. It would be great if maybe some others of you could please have a look and get this done in the near future. I'd really like to see this "un-broken".
  20. Andreas Wolf commented on patch set 4 V +1 CR +1 06/25/14, 12:50

    Patch works for me, I also see what the problem is. I'm however unhappy with the commit message, as it does not clearly state what the problem is – will fix that later. Also I had an issue that images were not scaled in my configuration when the target width was specified with the image content element. I can reproduce that behaviour and will further investigate, so we can at least mention this change in the commit message.
  21. Markus Klein commented on patch set 4 06/25/14, 23:14

    @Andreas: I agree the message is a bit too short and does not state what is changed. To clarify: The commit message shall NOT state the problem, but shall describe what is changed. Please file another ticket for the second bug you found and add me as watcher too. Thx.
  22. Stefan Neufeind commented on patch set 4 06/28/14, 18:29

    Somebody please take a final look, maybe take care of the array-index in ContentObjectRenderer.php (see comments) or not, file a separate ticket for followup and whatelse. It would be great to get this through somehow :-)
  23. Markus Klein commented on patch set 4 V +2 CR +2 06/28/14, 18:56

    Do the cleanups as followup
  24. Markus Klein merged patch set 5 06/28/14, 18:56

  25. Markus Klein commented on patch set 5 06/28/14, 18:57

    Cherry Picked This patchset was cherry picked to change: Iff28d9561e10f7581041bcc35bd56dfc972954b3