-
Notifications
You must be signed in to change notification settings - Fork 466
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
Support for Krita's .kra files #2239
Comments
You can implement it as a custom previewer via the Lua plugin system, https://yazi-rs.github.io/docs/plugins/overview#previewer |
Ah, thank you for spotting this direction! I think, that should fit my needs, but I'm a little struggle to implement my logic. I have the following file structure:
With the following content of [plugins]
prepend_previewers = [
{ name = "*.kra", run = "krita" }
]
preprend_preloaders = [
{ name = "*.kra", run = "krita" }
]
However, I don't see any message in yazi.log file except some irrelevant lines from yazi-adapter/src/emulator.rs file. Did I miss some important step? How can I investigate this issue? |
Use |
Yeah, I'm already using that and it included into my previous comment. I've found, that I had a typo in "prepend_preloaders", but fix changed nothing.
|
It should be yazi/yazi-config/preset/yazi-default.toml Lines 1 to 3 in abb4325
|
Ah, thank you, it works! And I've managed to display preview, so here it is: https://github.com/s-and-witch/krita-yazi-plugin I'm heavily relaying on this particular example: https://github.com/sxyazi/yazi/blob/shipped/yazi-plugin/preset/plugins/pdf.lua Do you have any suggestions? Maybe it is possible to use some plugin installer like packer for neovim? |
yazi --debug
outputPlease describe the problem you're trying to solve
Krita is an open-source painting program. Krita documents (link to a documentation) have
.kra
extension, but essentially are just a renamed zip archives with well known file structure. Asyazi
doesn't special-case them, it display zip archive guts. However, krita files could be handled in a better way.This is how yazi handle .kra files
Would you be willing to contribute this feature?
Describe the solution you'd like
Each
.kra
archive share some common properties. Here is his top-level structure:Interesting files are
mergedimage.png
,mimetype
andpreview.png
. Mimetype should always containapplicaiton/x-krita
:And it's even detected by
file
utility:This should be enough to determine if we are dealing with
krita
file or not.preview.png
is a shrinked preview of a document with a bigger side equal to 256 pixels. However, I would suggest you to usemergedimage.png
file. It has the same content, but isn't shrinked, so user would have a better quality preview.So, here is how I think this should work:
mergedimage.png
file.png
files.zip
file handling.Additional context
I'm not familiar with rust in general and with yazi code base in particular, so I'm not checking the mark above. However I may try to implement that by myself if you point me out to exact location where this logic should be implemented.
Checklist
The text was updated successfully, but these errors were encountered: