• Plugin Author Arno Welzel

    (@awelzel)


    Lightbox with PhotoSwipe now also supports SVG images in the lightbox :-).

    However – this needs some prerequisites:

    1. WordPress itself does not support SVG out of the box for security reasons. You need to enable this first by installing a plugin like SVG Support.
    2. The SimpleXML extension of PHP must be available (this is usually the case, but if you see a notice in the backend options about a missing SimpleXML extension ask your hoster or administrator to enable it – otherwise SVG can not be displayed at all since the plugin needs to read the SVG files to determine the viewbox size).
    3. The SVG images need either a default size or a viewbox size defined in the root element of the SVG structure. Without this, an SVG image can not be displayed in the lightbox and will be ignored.

    For a working example see here: https://arnowelzel.de/en/shift-registers

    This is an article which contains schematics as SVG images. These can be opened and zoomed.

    There is also a new backend setting to allow scaling the SVG images when opened in the lighbox. This can be useful of the original viewbox is smaller than the size of the screen (e.g. less than 1920*1080) and you want to have the image as big as possible in the lightbox.

    • This topic was modified 3 years, 3 months ago by Arno Welzel.
  • The topic ‘SVG support’ is closed to new replies.