Comments (13)
I found some code in renderer that assumes width and height are equal values when dealing with cell width and height.
Easy mistake to make, took me literally staring it in the face to notice. I'd say I'll have a PR up shortly, but I feel like I'm looking at more than one bug here, so we'll see
from image.nvim.
@3rd PS: This plugin is super exciting, you are a wizard! I can't stop smiling about the penguins with transparent background right in my quarto document!
from image.nvim.
In a more isolated setting, only rendering the image at the cursor, what I see is that when I first jump to a line, e.g. using a search or a mark, it crops and shows the top left corner (behaviour 1):
but after moving from and back to the line once (jk
) it shows the scaled image:
then, after scrolling with the mouse wheel and clicking back to the line I get and even smaller version:
from image.nvim.
I'm here to add that opening a large enough floating window allows the image to render without being cropped, but it's scaled to half the size that it should be. I see this behavior in Molten as well
from image.nvim.
Now to deal with this: Images getting both scaled and cropped
heh that one was my fault.
I'm going to look into that shrinking issue now b/c that also happens to me all the time. I have an idea of what's causing it too
Oh god I'm just jumping all over the place, there's an issue with the native cropping method. I'm not sure what it is, but I'm looking into it
When it uses a backend cropping method like kitty's then it doesn't set the image to the scaled version which causes something like this to happen:
from image.nvim.
@jmbuhr I think #46 also fixes the issue you described. I don't seem to be having it anymore
from image.nvim.
Okay, there's actually still one inconsistency here. Scrolling an image down in a floating window (or probably any window that isn't at the bottom of the screen) will resize the image, while an image at the bottom of the screen gets cropped.
@3rd I'm curious what you think the behavior should be here. I'm heavily in favor of cropping in floating windows for a few reasons:
- Cropping is lighter on resources for kitty users, it's probably faster than a resize and it takes up much less space b/c we don't have to cache the cropped images
- If someone using the api wants to resize they can already do that by passing geometry to render, there is currently no way to crop manually
- cropping at the bottom of all windows instead of just at the bottom of the screen is more consistent
screen_cap.mp4
from image.nvim.
We can add a image.auto_resize bool to turn off resizing per-image, would that work?
from image.nvim.
My issue is more with when it resizes and when it doesn't, it's currently not consistent between images that have a window and images that don't have a window. So if we add auto-resize could we make it off by default?
Also, is there any reason that kitty isn't cropping images on the right or left side of a window?
from image.nvim.
Not sure if left/right crop is implemented with Kitty, will check.
If an image is not mounted on a window & buffer it shouldn't be resized/cropped at all, the API user should have full control.
For images that are attached to a window and buffer it should behave the same and crop images at the window bounds, images should not be resized depending on scroll position.
I'll look into it!
from image.nvim.
I have a branch that makes things so they work the way you just described and adds left/right crop
from image.nvim.
screen_cap.mp4
from image.nvim.
I have a branch that makes things so they work the way you just described and adds left/right crop
Awesome, looks great!
from image.nvim.
Related Issues (20)
- Image is still shown when switched to another tmux window HOT 5
- Not working on Alacritty. HOT 2
- [bug] Unfolding images causes them to draw at the cursor position (and other weird folding behavior) HOT 1
- [bug] get images api changed in the namespace commit HOT 1
- [BUG] Image display override floating windows HOT 4
- Windows support? HOT 3
- Image ignores soft text wrapping HOT 1
- [feature request] Obsidian Link support HOT 3
- [bug] removing and adding image in buffer while images are displayed in a split HOT 1
- YALRMI: Yet Another LuaRocks Magick Issue HOT 7
- The picture cannot be displayed and the corresponding position is garbled. HOT 3
- Messes with lualine HOT 2
- Luarock magick abandoned HOT 19
- GIF rendered incorrectly HOT 3
- Background of telescope became transparent HOT 1
- `nvim: src/unix/core.c:148: uv_close: Assertion '!uv__is_closing(handle)' failed` when closing nvim; doesn't happens with `backend = "ueberzug"` HOT 3
- spamming error when in command-line-window
- How can i make it to only show image when key pressed? HOT 4
- JPEG Header detection supports only JFIF, but not variations such as EXIF, SPIFF, Adobe JPEG and other HOT 3
- inline image render overlaps status line
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.nvim.