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

preview **SVG** images using kitty #2955

Open
gregidonut opened this issue Feb 25, 2024 · 2 comments
Open

preview **SVG** images using kitty #2955

gregidonut opened this issue Feb 25, 2024 · 2 comments

Comments

@gregidonut
Copy link

gregidonut commented Feb 25, 2024

Runtime Environment

  • Operating system and version: Arch Linux x86_64 ( Kernel: 6.7.6-arch1-1 )
  • Terminal emulator and version: kitty 0.31.0
  • Python version: 3.11.7
  • Ranger version/commit: kitty 0.31.0
  • Locale: en_US.UTF-8

Current Behavior

not showing previews for svg file images

Expected Behavior

show previews for svg file images

Context

idk how the call the show the images as previews is implemented in ranger but according to this page from kitty running a command like this:

kitten icat image.jpeg

should just work and it does for me(for svg files) with the regular shell

i think i have enabled the correct configurations from the rc.conf file with this two lines

set preview_images true
set preview_images_method kitty

and other image file types do work fine, like jpeg or png, i see previews of them without explicitly opening them. but i'd like it to be the same for svg files as well. which it should since it works with the kitty's regular graphics protocol with the icat subcommand.

Possible Solutions

Steps to reproduce

  1. just select an svg file while preview images is true while kitty is the configured terminal

Traceback


@holzboa
Copy link

holzboa commented Mar 15, 2024

edit your scope.sh - should look like this:

## SVG
         image/svg+xml|image/svg)
             convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
             exit 1;;

@windupbird144
Copy link

In addition to @holzboa 's comment.

In scope.sh the respective lines need to be in the handle_image function.
In my case the lines were already present, but commented out. (131-133 in the screenshot below)
Uncomment the lines and you should be good to go.

image

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