Review main Merged

38422[FEATURE] Add SVG support

Frans Saris CR +2 V +2 Hard +212 −44 updated 04/10/15, 09:35

Commit message

Added rendering support for SVG images. When a SVG image is scaled
there is no processed file created but only a sys_file_processedfile
record with the calculated new dimensions.

When a mask or explicit cropping is set for an SVG image a
processed file is created like for all other images.

An extra fallback is added to ImageInfo to determine SVG dimensions when
IM/GM fails.

Review

  • Code review CR +2
    • Wouter Wolters +2
    • Markus Klein +1
    • Benjamin Kott +1
  • Verified V +2
    • Wouter Wolters +2
    • Benjamin Kott +1

Issues 1

Files 17

Review log 30

Show 5 earlier messages
  1. Frans Saris uploaded patch set 1 04/01/15, 20:33

  2. Benjamin Kott commented on patch set 1 V -1 04/01/15, 21:14

    Great work so far, but ive also encountered some issues. - PDF are delivered to the frontend and preview missing - AI are delivered to the frontend and preview missing (not sure if it worked before) - SVG previews are not shown in irre relations (fal) intentional?
  3. Frans Saris uploaded patch set 2 04/02/15, 19:53

  4. Frans Saris commented on patch set 2 04/03/15, 18:26

    Needs a rebase after https://review.typo3.org/#/c/38468/ is in. Moves some of these changes to a different patch
  5. Benjamin Kott commented on patch set 2 V -1 04/03/15, 18:26

    Filelist: preview images missing for .ai, pdf Edit Metadata: preview images missing for .ai, .pdf Page Module: preview images missing for .ai, .pdf, .svg Edit Record (FAL): preview images missing for .ai, .pdf, .svg Frontend Rendering (with responsive images): Images missing for .ai, .pdf, .svg
  1. Benjamin Kott commented on patch set 2 04/03/15, 18:27

    Filelist: preview images missing for .ai, pdf Edit Metadata: preview images missing for .ai, .pdf Page Module: preview images missing for .ai, .pdf, .svg Edit Record (FAL): preview images missing for .ai, .pdf, .svg Frontend Rendering (with responsive images): Images missing for .ai, .pdf, .svg
  2. Frans Saris uploaded patch set 3 04/03/15, 20:02

  3. Benjamin Kott commented on patch set 3 CR +1 V +1 04/03/15, 20:18

    looks good - awesome!
  4. Wouter Wolters voted on patch set 3 CR +1 04/03/15, 20:24

  5. Frans Saris commented on patch set 3 04/03/15, 20:33

    This changes needs to be merged first https://review.typo3.org/#/c/38468/ . Reviews welcome :)
  6. Benjamin Kott uploaded patch set 4 04/04/15, 15:00

  7. Benjamin Kott commented on patch set 4 CR +1 V +1 04/04/15, 15:00

    rebase
  8. Benjamin Kott uploaded patch set 5 04/04/15, 15:07

  9. Frans Saris uploaded patch set 6 04/08/15, 10:03

  10. Frans Saris commented on patch set 6 04/08/15, 10:06

    You can test this by uploading an SVG file and then look at the <img tag in FE output, or in the BE previews. The src should point to the original file and width + height should be set.
  11. Benjamin Kott voted on patch set 6 CR +1 V +1 04/08/15, 19:14

  12. Benjamin Kott commented on patch set 6 04/08/15, 19:23

  13. Markus Klein commented on patch set 6 04/08/15, 19:35

    Great. Rendering width/height now explicitly also speeds up the rendering in browser as it already knows the image dimensions upfront.
    the or a
    An extra

    InlineElement.php:620

    Is there no better way to detect if the processing was successful? This relies on width not being available in case blu blab happened.

    LocalCropScaleMaskHelper.php:218

    multiply first and divide at the end to gain maximum precision.

    LocalPreviewHelper.php:44

    Please document what is returned in the array

    ImageInfo.php:79

    to find or to set?

    Feature-50136-AddSVGSupport.rst:8

    an

    Feature-50136-AddSVGSupport.rst:10

    image,

    Feature-50136-AddSVGSupport.rst:12

    An extra

    Feature-50136-AddSVGSupport.rst:12

    word missing
  14. Frans Saris commented on patch set 6 04/09/15, 06:57

    InlineElement.php:620 Reply

    currently there is no better way. Is something for when the whole file processing is re-done/refactored. Will for now adjust the comment.

    LocalCropScaleMaskHelper.php:218 Reply

    Done

    LocalPreviewHelper.php:44 Reply

    Done

    ImageInfo.php:79 Reply

    Done

    Feature-50136-AddSVGSupport.rst:8 Reply

    Done

    Feature-50136-AddSVGSupport.rst:10 Reply

    Done

    Feature-50136-AddSVGSupport.rst:12 Reply

    Done
  15. Frans Saris uploaded patch set 7 04/09/15, 06:57

  16. Markus Klein voted on patch set 7 CR +1 04/09/15, 10:00

  17. Benjamin Kott voted on patch set 7 CR +1 V +1 04/09/15, 19:28

  18. Wouter Wolters voted on patch set 7 CR +1 04/09/15, 20:12

  19. Wouter Wolters voted on patch set 7 V +2 CR +2 04/09/15, 20:42

  20. Wouter Wolters merged patch set 7 04/09/15, 20:42

  21. Felix Kopp commented on patch set 8 04/09/15, 21:01

    Works well! ElementInfo, TCA, List, Preview, IRRE preview :)
  22. Felix Kopp commented on patch set 8 04/09/15, 21:02

    In Page module the tt_content image might break the column width since the width is show, no problem
  23. Frans Saris commented on patch set 8 04/10/15, 06:05

    @Felix, do not think that would break column width as the images just jumpt to a new line when if they do not fit. Or do you mean something else?
  24. Felix Kopp commented on patch set 8 04/10/15, 08:42

    Hi Frans, please see the screenshot at https://forge.typo3.org/issues/50136#note-15. I guess caused by the width/height parameters and missing img-responsive CSS class in page module?
  25. Frans Saris commented on patch set 8 04/10/15, 09:35

    that shouldn't happen. In the other views the width/height are set correct? Irre, elementInformation etc. The width/height should be max 150x150