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

Pre-generating color data to asset meta #12

Open
adevade opened this issue May 12, 2022 · 5 comments
Open

Pre-generating color data to asset meta #12

adevade opened this issue May 12, 2022 · 5 comments

Comments

@adevade
Copy link

adevade commented May 12, 2022

Is there a way to pre-generate the colors to all assets? Say via a command or something?

This would be a good feature otherwise. Helps speed up the first page load for pages with many images! 👍

@aryehraber
Copy link
Owner

Hey @adevade, this is a great idea and would definitely be useful since, as you said, initial load times can be quite long when using many images.

I don't have much time to work on such a feature at the moment, but I'd be happy to review a PR!

Thanks!

@adevade
Copy link
Author

adevade commented May 12, 2022

Nice! I think I could give the PR it a shot!

Do you think it should be its own command (like please assets:extract-color-meta), or should i hook into please assets:meta?
That command basically loops through and saves all assets, generating meta files.

We could also hook into the AssetSaved event, and generate the colors whenever an asset is saved?

EDIT: Or once on AssetUploaded? Maybe available as a config option? It could generate all three types at upload.

@aryehraber
Copy link
Owner

Interesting ideas!

I think a dedicated command like please assets:extract-color-meta sounds good, however I'm a little hesitant to generate it for ALL image files, since this can easily run into the hundreds of MBs or even GBs on larger projects, which will take ages. At risk of making it too complex, perhaps the command can take a Container and/or Folder path into account, allowing the user to scope it to just the images they need. Thoughts?

I think auto-generating on AssetSaved/AssetUploaded would be a nice one (via a config option, of course).

@Burans
Copy link

Burans commented Dec 5, 2024

Hey! Did this ever get implemented in some way?
I replaced a bunch of images manually in the assets folder and now i need to recalculate colors for all of them.
Thanks!

@aryehraber
Copy link
Owner

@Burans No, nothing was ever implemented, unfortunately. Depending on your needs, maybe you can mass-delete the existing color meta data from the asset meta data files? That way it should get recalculated next time the image is used with the addon.

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

3 participants