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

Fix slow performance of raster image marker #60604

Merged
merged 2 commits into from
Feb 14, 2025
Merged

Conversation

nyalldawson
Copy link
Collaborator

  • More efficient cloning of QgsRasterMarkerSymbolLayer, which doesn't require a re-open of the image file
  • Cache original image sizes

Fixes #51273

Avoid having to open image file to clone marker

Refs qgis#51273
QgsImageCache::originalSize required a re-open and parse of the
image with every call, which could result in many file opens
to the same image file.

Use a cache to store these instead, so that we only have
to determine the size once.

Note that this isn't as simple as storing the size in a hash,
as we need to handle file modifications like QgsImageCache does.
Accordingly, we subclass QgsAbstractContentCache and specialise
it for handling just the image size here.

Fixes qgis#51273
@github-actions github-actions bot added this to the 3.42.0 milestone Feb 14, 2025
Copy link

github-actions bot commented Feb 14, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 12cffa3)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 12cffa3)

@alexbruy alexbruy merged commit df80fe3 into qgis:master Feb 14, 2025
35 checks passed
@nyalldawson nyalldawson deleted the fix_51273 branch February 18, 2025 01:31
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.

Excessive amount of file transactions
2 participants