image: Make the resolution of catimg configurable.

This commit is contained in:
Dylan Araps 2018-05-21 08:29:50 +10:00
parent 0fe972073f
commit a27382d21d
2 changed files with 14 additions and 1 deletions

View File

@ -747,6 +747,14 @@ crop_offset="center"
# --size # --size
image_size="auto" image_size="auto"
# Catimg block size.
# Control the resolution of catimg.
#
# Default: '2'
# Values: '1', '2'
# Flags: --catimg_size
catimg_size="2"
# Gap between image and text # Gap between image and text
# #
# Default: '3' # Default: '3'
@ -3842,7 +3850,7 @@ display_image() {
;; ;;
"catimg") "catimg")
catimg -w "$((width * 2 / font_width))" "$image" ||\ catimg -w "$((width * 2 / font_width))" -r "$catimg_size" "$image" ||\
to_off "Image: catimg failed to display the image." to_off "Image: catimg failed to display the image."
;; ;;
@ -4778,6 +4786,7 @@ IMAGE:
in some terminals emulators when using image mode. in some terminals emulators when using image mode.
--size 00px | --size 00% How to size the image. --size 00px | --size 00% How to size the image.
Possible values: auto, 00px, 00%, none Possible values: auto, 00px, 00%, none
--catimg_size 1/2 Change the resolution of catimg.
--crop_mode mode Which crop mode to use --crop_mode mode Which crop mode to use
Takes the values: normal, fit, fill Takes the values: normal, fit, fill
--crop_offset value Change the crop offset for normal mode. --crop_offset value Change the crop offset for normal mode.
@ -4940,6 +4949,7 @@ get_args() {
# Image options # Image options
"--loop") image_loop="on" ;; "--loop") image_loop="on" ;;
"--image_size" | "--size") image_size="$2" ;; "--image_size" | "--size") image_size="$2" ;;
"--catimg_size") catimg_size="$2" ;;
"--crop_mode") crop_mode="$2" ;; "--crop_mode") crop_mode="$2" ;;
"--crop_offset") crop_offset="$2" ;; "--crop_offset") crop_offset="$2" ;;
"--xoffset") xoffset="$2" ;; "--xoffset") xoffset="$2" ;;

View File

@ -276,6 +276,9 @@ in some terminals emulators when using image mode.
How to size the image. How to size the image.
Possible values: auto, 00px, 00%, none Possible values: auto, 00px, 00%, none
.TP .TP
\fB\-\-catimg_size\fR 1/2
Change the resolution of catimg.
.TP
\fB\-\-crop_mode\fR mode \fB\-\-crop_mode\fR mode
Which crop mode to use Which crop mode to use
Takes the values: normal, fit, fill Takes the values: normal, fit, fill