Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support img tags in HTML label text #58716

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Sep 16, 2024

  1. Allow HTML data urls for QgsImageCache

    Adds support for base64 encoded image decoding when the path
    is a HTML data URL (in addition to the existing "base64:..."
    format support)
    
    Allows use of eg "data:image/jpeg;base64,XXXXXXXX" formats
    for image paths, so that the image cache can correctly handle
    embedded image paths from HTML/CSS content
    nyalldawson committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    84b1004 View commit details
    Browse the repository at this point in the history
  2. Allow QgsTextFragment to represent an inline image object

    Modifies the QgsTextDocument API to extract images from HTML
    content, and store in the associated
    QgsTextFragment/QgsTextCharacterFormat objects
    nyalldawson committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    edcd18f View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

  1. [feature] Support img tags in HTML label text

    Allows use of img tags in HTML label content. The following logic
    is applied:
    
    - Image path is set via the src="xxx" attribute. Local, HTTP, and
    base64 encoded paths are permitted
    - Any image format readable by QGIS can be used
    - Image sizes can be specified via the width="##" and height="##"
    attributes. If width or height is not specified it will automatically
    be calculated from the original image size
    - If width or height are specified, they are considered to be
    in POINTS
    - The css width/height settings are NOT respected (this is a Qt
    limitation)
    - Images are not supported for curved text labels
    - Images are placed inline only, floating images are not supported
    
    Sponsored by City of Freiburg im Breisgau
    nyalldawson committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    3d66bb8 View commit details
    Browse the repository at this point in the history
  2. Test masks

    nyalldawson committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    ee94f2d View commit details
    Browse the repository at this point in the history