You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of image.nvim converts non-PNG files (e.g., SVG) to PNG when opening Markdown files. This freezes my neovim when there are many SVG files, as the conversion happens every time Neovim starts.
Proposed Solution
Introduce an option to specify a custom directory for storing converted PNG files. This option will:
Allow users to set a directory (e.g., ~/Trash/imageConvert) for all converted files.
Before converting a non-PNG file to PNG:
Check if a converted PNG file already exists in the specified directory.
If the file exists, load the cached PNG file instead of re-converting.
If not, convert the file and save it to the specified directory with an appropriate name.
This may improve performance by avoiding redundant conversions.
my hard-coded solution
I have already implemented a hard-coded solution by modifying lua/image/image.lua, but I am looking forward to a more elegant and configurable implementation."
The text was updated successfully, but these errors were encountered:
xuwei152
changed the title
Feature request: add option to put converted file in a specific directory to avoid redundant conversions
Feature request: add option to put converted png files in a specific directory to avoid redundant conversions
Nov 23, 2024
Agree it's an issue, wondering how to handle the last modified checks.
Some users need the images to be reloaded if they change externally, and I'm not sure if the lazy way dir/{name}_{last_modified}-source.png
What do you think?
Problem Description
The current implementation of image.nvim converts non-PNG files (e.g., SVG) to PNG when opening Markdown files. This freezes my neovim when there are many SVG files, as the conversion happens every time Neovim starts.
Proposed Solution
Introduce an option to specify a custom directory for storing converted PNG files. This option will:
~/Trash/imageConvert
) for all converted files.This may improve performance by avoiding redundant conversions.
my hard-coded solution
I have already implemented a hard-coded solution by modifying
lua/image/image.lua
, but I am looking forward to a more elegant and configurable implementation."The text was updated successfully, but these errors were encountered: