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

[background image] Clean up unused background images from .ufo and .fontra #1813

Open
Tracked by #1777
justvanrossum opened this issue Nov 18, 2024 · 3 comments
Open
Tracked by #1777

Comments

@justvanrossum
Copy link
Collaborator

justvanrossum commented Nov 18, 2024

Currently, background image data is never deleted, even if they are no longer referenced by any glyphs.

We need to determine a scheme when to delete the underlying image data. This is somewhat tricky, as the image data does not participate in undo and change objects.

This needs to be implemented both for the .designspace backend and for the .fontra backend.

@ollimeier
Copy link
Collaborator

Here some ideas:

1: I am wondering if we could have something like a removedDate-tag, which stores the date when the image got removed and then after XX days the image gets deleted based on the removedDate? And if removedDate=false, keep it.

2: When deleting the image a dialog could pop up with the question if you want to "delete forever" the image, no undo possible.

3 (only possible for Fontra Pak): Closing the app triggers a script which deletes the removed images. Not sure how this idea would work with Fontra running on a server.

@ollimeier
Copy link
Collaborator

Another idea: Fontra has somewhere a temporary folder, right? We could move the image to the temporary folder when removed and with undo we could get it back from the temporary folder. I expect that this temporary folder will be deleted some day, am I right?

@justvanrossum
Copy link
Collaborator Author

One complication (at least in UFO) is that background images can be reused in multiple glyphs. Perhaps designspace/ufo need a different approach from Fontra (where so far the concept is to never reuse images).

The "delayed" delete approach is what I was thinking of. But the temporary folder idea sounds usable. (Fontra doesn't have a dedicated temp folder, but we can make temp folders easily.)

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

No branches or pull requests

2 participants