Bug report #13565
modifying a svg already cached doesn't invalidate the cache, renders as version initially loaded during a session
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21607|
Once a svg file is loaded during a qgis session, its cache stays fixed, even if the svgs are edited / modified. It's a problem when users want to finetune their svg graphics as it forces them to restart the application or create endless new files for edited svgs.
Check file modified time when retrieving svg images from cache
If file has been modified since the cache, regenerate a new cache
We don't want to check the file modified time too often though,
(e.g., we don't want to check for every point render in a 100k
point file), so use a hardcoded 30 second minimum time between
consecutive file modified checks.
This means that file modifications occuring more often than
every 30 seconds won't be picked up till 30 seconds has elapsed
since the last modification. But at the same time it means that
if the render takes < 30 seconds we'll only check each svg
at most once (and if a render takes > 30 seconds, adding a few
more milliseconds won't hurt!).
#4 Updated by Jérémy Billant almost 2 years ago
Håvard Tveite wrote:
I am developing a Python plugin that is generating SVG symbols for a layer, and since I am reusing file names for the SVGs I am hitting this bug.
Are there any other workarounds than making sure that every SVG file name is unique?
Same problem here. I use timestamp in my SVG file names to make them unique, but I don't really like this solution and so don't release my plugin.
Does any fix is planned? It would be great!