Skip to content

Add support for screenshot on plugins#236

Draft
Xpirix wants to merge 1 commit intoqgis:masterfrom
Xpirix:plugin_screenshot_support
Draft

Add support for screenshot on plugins#236
Xpirix wants to merge 1 commit intoqgis:masterfrom
Xpirix:plugin_screenshot_support

Conversation

@Xpirix
Copy link
Copy Markdown
Collaborator

@Xpirix Xpirix commented Feb 4, 2026

Closes #41

Overview

This feature adds screenshot support for QGIS plugins, allowing plugin developers to include preview images in their plugin packages. Screenshots are automatically extracted and displayed on plugin detail pages, helping users visualize plugins before installation.

What This Feature Enables

For Plugin Developers

  • Include screenshots in plugin packages - Add preview images directly in your plugin's ZIP file
  • Automatic extraction - Screenshots are automatically extracted and displayed when you upload a new version
  • Easy updates - Update screenshots by uploading a new plugin version with a different image
  • Flexible formats - Support for PNG, JPG, JPEG, and GIF image formats
  • Reasonable size limits - Screenshots up to 2MB are supported

For Plugin Maintainers

  • Manual management - Upload or change screenshots through the plugin edit form
  • Persistent screenshots - Manually set screenshots remain until replaced
  • Version tracking - Historical record of screenshots included with each version

For Plugin Users

  • Visual previews - See what plugins look like before installing
  • Better discovery - Screenshots help identify plugins that match your needs
  • Enhanced documentation - Visual context alongside plugin descriptions

How to Add a Screenshot to Your Plugin

1. Prepare Your Screenshot

  • Format: PNG, JPG, JPEG, or GIF
  • Size: Maximum 2MB
  • Dimensions: Any size (will be displayed responsively on the page)
  • Content: Showing your plugin's interface, output, or functionality
  • Name: Any filename (e.g., preview.png, screenshot.jpg)

2. Add Screenshot to Plugin Package

Place your screenshot file in the plugin's root directory:

my_plugin/
├── __init__.py
├── metadata.txt
├── preview.png          ← Your screenshot file
├── icon.png
└── ... other files

3. Update metadata.txt

Add the screenshot field to your metadata.txt:

[general]
name=My Amazing Plugin
description=A plugin that does amazing things
version=1.0.0
qgisMinimumVersion=3.0
author=Your Name
email=your.email@example.com
about=Detailed description of what this plugin does
tracker=https://github.com/yourname/myplugin/issues
repository=https://github.com/yourname/myplugin
screenshot=preview.png

4. Upload Your Plugin

Upload your plugin package through any method:

  • QGIS Plugin Repository website (manual upload)
  • XML-RPC API (automated upload from QGIS)
  • Token-based authentication

The screenshot will be automatically extracted and displayed!

Screenshot Display

Screenshots appear on:

  • Plugin detail pages - In the "About" tab
  • Plugin listings - Helping users browse available plugins

Manual Screenshot Management

Plugin maintainers can also:

  1. Upload screenshots via edit form - Use the plugin edit page to add or change screenshots without uploading a new version
  2. Update existing screenshots - Replace screenshots at any time
  3. Remove screenshots - Clear screenshot if no longer needed

Note: Screenshots manually uploaded via the edit form will persist until:

  • A new plugin version with a screenshot is uploaded (which replaces it)
  • The screenshot is manually removed or replaced

Important Notes

  • Optional field - Screenshots are completely optional; plugins work fine without them
  • Existing plugins - Plugins uploaded before this feature continue to work normally
  • Size validation - Files larger than 2MB will be rejected
  • Format validation - Only image files (PNG, JPG, JPEG, GIF) are accepted
  • Version-specific - Each plugin version can include its own screenshot
  • Automatic updates - When you upload a new version with a screenshot, it becomes the displayed screenshot
image

@Xpirix Xpirix requested a review from timlinux February 4, 2026 16:12
@Xpirix Xpirix marked this pull request as ready for review February 4, 2026 16:12
@Xpirix Xpirix marked this pull request as draft February 13, 2026 12:23
@Guts
Copy link
Copy Markdown
Contributor

Guts commented Apr 16, 2026

Thank you for this proposed change, which I believe is a step in the right direction for fostering good interaction between plugin developers and end users of QGIS.

I do have a few comments, however.

  • it should be possible to link to an external image, while restricting access to the sites/domains specified in the homepage and repository URLs
  • I am not in favor of storing images in the plugin ZIP file; this will significantly increase the size of the ZIPs, and, in all likelihood, the image will not be used once the plugin installed so it should be outside the "runtime" code.
  • Regarding image formats, prioritize the most recent/modern and compressed ones: WebP, WebM, AVIF...
  • As for constraints, I think we should still provide a range of dimensions (aspect ratio)

@kannes
Copy link
Copy Markdown
Contributor

kannes commented Apr 17, 2026

I also have mixed feelings, @Guts beat me to it with some :)

Since many plugins don't have any documentation at all, it would be great to incentivize at least screenshots. This would make it easier to know what a plugin supposedly does. So this seems like a very nice feature to me!

  • 2 Megabytes seems a lot to me. I would expect <500 Kilobytes to be enough for pretty much all reasonably useful screenshots?
  • 👎 to animated image formats
  • I would suggest a strong policy on acceptable content. Else I would be afraid of "guy doing faces thumbnail" clickbait, logos instead of screenshots or AI slop.

Re @Guts:

  • -1 to allowing external hosts. I am a strong believer in website visitor privacy and it should not be possible for a random third-party to control what I am looking at on the QGIS plugins website.
  • +1 to the bloat. Including cosmetic images in plugins would also bloat the QGIS user profiles. I would prefer if this was purely stored in the plugins website.
  • +1 to more of modern image formats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possibility to add screenshots to a plugin

3 participants