Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Html parses can't handle png-images if default image format is jpg #52

@Bellfalasch

Description

@Bellfalasch

In the <xsl:if test="$source-image"> on row 150 of the html.xsl we need to make sure that the $format param is used for the stk:image-create call. Otherwise transparent PNG images will always turn into opaque JPEG-images if Theme default image format is set to be JPG.

This little code inside that if check current file ending and forces "png" if original image is png. In the call-template later add <xsl:with-param name="format" select="$format" />.

<xsl:variable name="format">
    <xsl:choose>
        <xsl:when test="stk:file.get-extension( $source-image/binaries/binary[@label = 'source']/@filename ) = 'png'">
            <xsl:value-of select="'png'"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="$stk:default-image-format"/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:variable>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions