Review main Merged

67344[BUGFIX] Use custom image file extensions for image processing tests

Guido Schmechel CR +2 V +2 Easy +14 −2 updated 01/06/21, 11:17

Commit message

If an integrator removes image file extensions, e.g. "gif", from
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] the whole image
processing test in the install tool fails.

That's because some tests need to run independent of the global
configuration. Therefore the GraphicalFunctions class, which is
used as the image processor, now features a setter. This allows
EXT:install to manually define required image extensions for the
tests, which should not consider the global configuration.

Note: The `convertImageFormatsToJpg` test, which tries to
convert every defined image file extension (based on the
global configuration) to JPG, is not affected by this change.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Martin Kutschker +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Martin Kutschker +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1621

  1. Guido Schmechel uploaded patch set 1 01/05/21, 20:53

  2. TYPO3com voted on patch set 1 V +1 01/05/21, 21:05 Completed build in 11m 34s on Tue, 5 Jan, 09:05 PM Test Summary: 32557 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8653

  3. Oli Bartsch commented on patch set 1 CR -1 01/05/21, 21:20

    Personally I would not change/add that much in GraphicalFunctions. I think we first of all don't need a constant here and also should not change the $imageFileExt declaration. We only need to add the setter, to write to this variable from the outside (we also don't need the getter for now). In the constructor we can furthermore directly write to the variable, no need to use the setter. In the EnvironmentController we then just call the setter with needed extensions. Therefore we surely could use a constant but should make it private to be only used within EnvironmentController and only containing the needed extensions for the tests. What do you think?
  4. Oli Bartsch commented on patch set 1 01/05/21, 21:24

    EnvironmentController.php:1094

    !empty($testResult['outputFile'] seems to be duplicated. I furthermore think of merging the elseif and the if here.
  5. Oli Bartsch commented on patch set 1 01/05/21, 21:28

    GraphicalFunctions.php:316

    Please let's mark this as @internal.
  6. Oli Bartsch commented on patch set 1 CR 0 01/05/21, 21:40

    Sorry, overlooked the WIP state. So removing my -1, while my comments still apply :)
  7. Martin Kutschker commented on patch set 1 01/05/21, 21:49

    Reply

    The config of the class is created from $GLOBALS['TYPO3_CONF_VARS']['GFX'] including the image file extensions. If we opt for constructor argument rather then the setter I suggest adding a config array as argument. Any keys missing in the array are set from globals. Makes the constructor IMHO cleaner and paves the way for getting rid of the glocals in future TYPO3 versions. Adding the constant to the EnvironmentController sounds fine.

    GraphicalFunctions.php:38 Unresolved

    Both Imagemagick and GDLib support webp. Is it sensible to extend the list in this patch?
  8. Guido Schmechel uploaded patch set 2 01/05/21, 23:17

  9. Guido Schmechel uploaded patch set 3 01/05/21, 23:22

  10. Guido Schmechel commented on patch set 2 01/05/21, 23:23

    Reply Unresolved

    OK, so for now just the first step after your comments, so the whole thing simplified. The part with the constructor sounds more like refactoring than a bugfix to me, so i add as a suggestion the variant with the public variable in GraphicalFunctions. Would that be OK for this step? Btw: For the time being, I have not added webp to the GraphicalFunctions. There are also extra commands there, for example, and I don't know if that's so easy.

    GraphicalFunctions.php:316 Reply

    Done

    EnvironmentController.php:1094 Reply

    Embarrassing ;-)
  11. TYPO3com voted on patch set 2 V -1 01/05/21, 23:36 Completed build in 16m 09s on Tue, 5 Jan, 11:36 PM Test Summary: 1 of 32798 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8664

  12. TYPO3com voted on patch set 3 V -1 01/05/21, 23:42 Completed build in 13m 38s on Tue, 5 Jan, 11:42 PM Test Summary: 1 of 32798 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8665

  13. Oli Bartsch uploaded patch set 4 01/05/21, 23:51

  14. Oli Bartsch voted on patch set 4 V +1 CR +1 01/06/21, 00:03

  15. TYPO3com voted on patch set 4 V +1 01/06/21, 00:05 Completed build in 13m 03s on Wed, 6 Jan, 12:05 AM Test Summary: 32557 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8667

  16. Oli Bartsch updated the commit message in patch set 5 01/06/21, 00:16

  17. Oli Bartsch voted on patch set 5 V +1 CR +1 01/06/21, 00:17

  18. TYPO3com voted on patch set 5 V +1 01/06/21, 00:28 Completed build in 11m 46s on Wed, 6 Jan, 12:28 AM Test Summary: 32557 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8668

  19. Martin Kutschker voted on patch set 5 V +1 CR +1 01/06/21, 10:16

  20. Christian Kuhn voted on patch set 5 V +2 CR +2 01/06/21, 11:16

  21. Christian Kuhn merged patch set 6 01/06/21, 11:17