-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: rasterize node document leakage #3539
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
base: master
Are you sure you want to change the base?
fix: rasterize node document leakage #3539
Conversation
551fbb5 to
3ba2ad3
Compare
3ba2ad3 to
85c0f16
Compare
| } | ||
|
|
||
| if render_params.to_canvas() { | ||
| let id = row.source_node_id.map(|x| x.0).unwrap_or_else(|| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't fully understand this syntax but from what I can see this generates an ID for an image and was used in deduplication for similar images . Since we are no more deduplicating similar images and each new image is getting its own ID , figured it would be best to use a simple generate_uuid instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without doing so , its still causing the same image leakage for me
|
This ones ready to be reviewed from my side |
|
I need a bit more time to look at this, the workaround implemented here does not feel quite right, I'm also wondering if this will effect the performane as it is currently implemented |
|
@TrueDoctor yes it will be bad for performance. The hashing code for images is included below: Graphite/node-graph/libraries/raster-types/src/image.rs Lines 104 to 116 in fa45efa
However this will lead to very many conflicts when you have images such as the cases below: Since there are 1000x1000 pixels and the vast majority are white, these two both hash to the same thing. It is necessary for correctness that these two different images aren't treated as the same thing by the SVG rendering code. Otherwise it looks like the rasterize node is broken. Actually the rasterization works fine. An example graphite file where this collision occurs is include below: |
|
Yeah the hash is broken, I guess we could do an eq check after the hash calculation, that should hopefully be fast enough. But I guess we would need to benchmark if disabling the deduplication alltogether would be faster |
|
An example graphite file where this collision occurs is include below: What is this ?? and how is this used ? |
|
@Ayush2k02 Yes, you can import this graphite file into the Graphite editor. Note that the extension is |


Simple enough fix which skips the flawed deduplication check and generates a different id ( UUID ) for each new image
Screen.Recording.2025-12-28.at.7.46.56.PM.mov
Closes #3533