Closed dmtrKovalenko closed 8 months ago
Hi, you need to tune the max_width
and max_height
up as what you want - which will fit your terminal automatically, that's necessary for pre-caching images
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Thank you, @sxyazi for a quick answer, I am sorry for somehow missing this. I did what you said and set both of them to 4000. I also set image_alloc
to 0 and image_bound to [0,0] (all unlimited) and still seeing this
It became bigger but it is not taking up full pane. I think the whole idea that it not tries to scale the image up. While it probably should, if the image itself is small I would like to be able to still see it even if some artifacts are visible
Did you do a yazi --clear-cache
after setting max_width
and max_height
inside [preview]
in your ~/.config/yazi/yazi.toml
?
Yes exactly, the pretty big images display perfectly here is a 4k:
Oh, sorry, I seem to have misunderstood your intention.
Are you looking to enlarge an image that is initially smaller than your terminal window and to fill in it, rather than having an image larger than the terminal window to downscale to the terminal size?
If so currently, this is only can be implemented by the custom previewer - I'm not sure if it makes sense since enlarging a small image usually results in blurriness. However, I'm willing to discuss it and explore any possible way to impl it. Let me know your thoughts.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
I'm sorry to come back to a closed issue, but I feel this is a feature that could be interesting in some cases. I'm not well versed in Rust, but I looked at the Image implementation, especially at the downscale method: to me it seems like it could already work as a upscale method too if a (to add) flag can be passed to skip the fast path check and the check before the resize.
Pseudo-code (idk if its correct Rust):
// Fast path.
if img.width() <= w && img.height() <= h && orientation <= 1 && !upscale {
return Ok(img);
}
tokio::task::spawn_blocking(move || {
if (img.width() > w || img.height() > h) || upscale {
img = img.resize(w, h, Self::filter())
}
Ok(Self::rotate(img, orientation))
})
I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
What system are you running Yazi on?
macOS
What terminal are you running Yazi in?
kitty 0.31.0
Yazi version
yazi 0.1.5
Did you try the latest main branch to see if the problem has already been fixed?
Tried, but the problem is still present
Describe the bug
Terminal images previews in kitty does not scale and are not usable
Expected Behavior
This is how fzf with the jcorrect preview working
To Reproduce
Open any folder containing images using yazi in kitty
Configuration
This is reproducible on totally default configuration
Anything else?
I assume that there might be a missing
--scale-up
argument when getting a preview from the kitty. I can try to check the code and see if I can fix this issue once will get a green light from maintainers.