-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
@nyalldawson A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
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
Modifies the QgsTextDocument API to extract images from HTML content, and store in the associated QgsTextFragment/QgsTextCharacterFormat objects
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 |
Allows use of img tags in HTML label content. The following logic is applied:
Sponsored by City of Freiburg im Breisgau