Comments (6)
Forgot to post the image.svg
file to help reproduce the issue:
image.zip
from svglib.
I'm on vacation this week and can't test well. But I do remember vaguely having seen some kind of creation timestamps added by reportlab to the PDFs inside the info dict sessions. Svglib doesn't do anything special here and I would maybe suggest raising an issue on the reportlab repo on bitbucket.org.
from svglib.
@deeplook thanks for the answer.
But I do remember vaguely having seen some kind of creation timestamps added by reportlab to the PDFs inside the info dict sessions.
That makes sense, but I notice that we don't have the same problem when generating PDF with static images (png, jpg), tables or formatted text, only when we have a SVG file.
I will dig around the code to see if I encounter the reason for it.
Thanks again for your answer, and I hope you enjoy your vacation! π πΊ
from svglib.
We have made some improvements in reproducibility of the reportlab code. We now try to support the SOURCE_DATE_EPOCH environment variable; there is also the rl_config.invariant flag which may be used to make certain bits of reportlab more reproducible. However, as you discovered the random hashing introduced recently means that dictionary order is no longer constant.
from svglib.
@replabrobin thanks for info.
However, as you discovered the random hashing introduced recently means that dictionary order is no longer constant.
Indeed, but now that dicts in Python 3.6 are ordered, this might no longer be an issue in that Python version. I will check this and report back with what I find.
from svglib.
Hi,
Indeed with Python 3.6 the problem goes away: svglib
now always generates the same image files in separate executions (albeit different from files generated in Python 2.7). This indicates that the suspicion about the problem being the random order of dicts in Python>3,<3.6 is correct.
For my purposes it is sufficient to use Python 3.6 and upwards now that Python dicts will always preserve order, so this can be closed from my POV.
from svglib.
Related Issues (20)
- convert to pdf and png files is incorrect HOT 5
- wrong width and height attributes of drawing obj HOT 1
- Implementation error in rendering of paths with shorthand command for quadratic BΓ©zier curves HOT 5
- Transform on clipPath does not work HOT 2
- Error when svg file contains references to font with space in its name HOT 1
- Error on install svglib HOT 2
- Reportlab 4.0.0 added dependency to pycairo HOT 3
- Error ByteIO HOT 3
- svglib fails to render properly HOT 12
- CI failure because of missing cairo HOT 9
- Using root log instead of logger HOT 3
- Units px and pt are wrong HOT 5
- Embedding SVG fonts in PDF/rlg HOT 5
- Add font size test case to test suite
- Rename default branch to main HOT 2
- Add more example and pip install commands to README.md HOT 4
- svglib doesn't remove temporary files properly? HOT 5
- Problems with embedded image sizes HOT 4
- svglib ignores <switch> nodes HOT 4
- Please share wheel file on pypi HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svglib.