substance / texture

A visual editor for research.
MIT License
1k stars 83 forks source link

"replace figures" keep the image #1311

Open jcolomb opened 5 years ago

jcolomb commented 5 years ago

Describe the bug

when replacing a figure, the new figure is included in the dar file and the xml link to that file, but the old file is not erased from the dar file (so the file gets bigger for no reason !)

Steps To Reproduce

add a figure, replace it, look into the unzipped dar file.

Expected behavior

Figures not linked in the xml should be erased

Screenshots

If applicable, add screenshots to help explain your problem.

NB: same problem if one erase the figure completely .

michael commented 5 years ago

Hi @jcolomb! We are aware of this, and we still have not decided how to handle this situation. At the first glance it may seem that the assets could be deleted from the DAR file when removed. However, this would break undo/redo.

We have several options how to deal with this:

1) Purge on every save (then we would need to clear the undo/redo history) 2) Purge option in a separate file manager view. Like you see the images/files in general that are not referenced in the document with the option to purge them in a controlled manner.

Which approach would you favour?