kovidgoyal/kitty

Keep aspect ratio when renderring images

CarterLi opened this issue · 2 comments

Describe the bug

The document reads

If only one of either r or c is specified, the other one is computed based on the source image aspect ratio, so that the image is displayed without distortion.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout

But it doesn't seem to work

To Reproduce
Steps to reproduce the behavior:

  1. echo -e "\e_GX=1,a=T,f=100,t=f,c=50;$(echo -n ~/Desktop/test.png | base64)\e\\"

Screenshots

image

Environment details

kitty 0.34.1 (7f61f1f9f3) created by Kovid Goyal
Darwin MacBookPro-M1P 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
ProductName:		macOS ProductVersion:		14.4.1 BuildVersion:		23E224
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /opt/homebrew/bin/fish

Config options different from defaults:
Removed shortcuts:
	cmd+, →  edit_config_file
	cmd+enter →  new_window
	cmd+h →  hide_macos_app
	cmd+k →  clear_terminal to_cursor active
	cmd+m →  minimize_macos_window
	cmd+n →  new_os_window
	cmd+q →  quit
	cmd+t →  new_tab
	cmd+w →  close_tab
	ctrl+cmd+, →  load_config_file
	ctrl+cmd+f →  toggle_fullscreen
	opt+cmd+h →  hide_macos_other_apps
	opt+cmd+r →  clear_terminal reset active
	opt+cmd+s →  toggle_macos_secure_keyboard_entry
	shift+cmd+/ →  open_url https://sw.kovidgoyal.net/kitty/
	shift+cmd+[ →  previous_tab
	shift+cmd+] →  next_tab
	shift+cmd+d →  close_window
	shift+cmd+w →  close_os_window

Important environment variables seen by the kitty process:
	PATH                                /Applications/kitty.app/Contents/MacOS:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/gawk/libexec/gnubin:/Users/carter/.bun/bin:/opt/homebrew/opt/binutils/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/Current/bin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/ruby/bin:/Users/carter/.local/bin:/opt/homebrew/opt/fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/iTerm.app/Contents/Resources/utilities
	LANG                                zh_CN.UTF-8
	EDITOR                              nvim
	SHELL                               /opt/homebrew/bin/fish
	USER                                carter
	LC_TERMINAL_VERSION                 3.5.20240508-nightly
	LC_TERMINAL                         iTerm2

Additional context

kitty --config NONE was used

dup of #7380

So it was just implemented but not released yet?