Skip to content

Commit

Permalink
Refine man-page w.r.t to optional parameters.
Browse files Browse the repository at this point in the history
The optional parameters after `=` should be inside the [...] brackets.

`--title=[<format-string>]` -> `--title[=<format-string>]`
  • Loading branch information
hzeller committed Dec 31, 2023
1 parent e1cc618 commit cb3691a
Show file tree
Hide file tree
Showing 6 changed files with 558 additions and 547 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ Options (most common first):
-F<filelist> : like -f, but relative filenames considered relative
to the directory containing the filelist.
-b<str> : Background color to use behind alpha channel. Format
'yellow', '#rrggbb', 'auto' or 'none' (default 'auto').
color name like 'yellow', '#rrggbb', 'auto' or 'none'.
'auto' is terminal background color. (default 'auto').
-B<str> : Checkerboard pattern color to use on alpha.
--pattern-size=<n> : Integer factor scale of the checkerboard pattern.
--auto-crop[=<pre-crop>] : Crop away all same-color pixels around image.
Expand All @@ -105,8 +106,9 @@ Options (most common first):
-U, --upscale[=i]: Allow Upscaling. If an image is smaller than the
available frame (e.g. an icon), enlarge it to fit.
Optional parameter 'i' only enlarges in integer steps.
--clear : Clear screen first. Optional argument 'every' will
clear before every image (useful with -w)
--clear[=every]: Clear draw area first. Optional argument 'every' will
clear before every image (useful with -w/-wr,
but not with --grid)
-V : Directly use Video subsystem. Don't probe image
decoding first (useful, if you stream video from stdin)
-I : Only use Image subsystem. Don't attempt video decoding
Expand All @@ -125,13 +127,13 @@ Options (most common first):
(Default 3, 3/4 #cores on this machine)
--color8 : Choose 8 bit color mode for -ph or -pq
--version : Print detailed version including used libraries.
(v1.5.1+)
(v1.5.3+)
--verbose : Print some stats after images shown.
-h : Print this help and exit.
--help : Page through detailed manpage-like help and exit.
Scrolling
--scroll=[<ms>] : Scroll horizontally (optionally: delay ms (60)).
--scroll[=<ms>] : Scroll horizontally (optionally: delay ms (60)).
--delta-move=<dx:dy> : delta x and delta y when scrolling (default:1:0)
For Animations, Scrolling, or Video
Expand Down
22 changes: 14 additions & 8 deletions man/timg.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 3.1.8
.\" Automatically generated by Pandoc 3.1.9
.\"
.TH "timg" "1" "Jul 2023" "" ""
.TH "timg" "1" "Dec 2023" "" ""
.SH NAME
timg - A terminal image and video viewer
.SH SYNOPSIS
Expand Down Expand Up @@ -129,7 +129,7 @@ below).
\f[B]-C\f[R], \f[B]--center\f[R]
Center image(s) and title(s) horizontally in their alotted space.
.TP
\f[B]--title=[format-string]\f[R]
\f[B]--title\f[R][=<\f[I]format-string\f[R]>]
Print title above each image.
It is possible to customize the title by giving a format string.
In this string, the following format specifiers are expanded:
Expand Down Expand Up @@ -244,7 +244,7 @@ terminal, so might require scrolling to see the full picture.
Default behavior is to fit within the allotted width \f[I]and\f[R]
height.
.TP
\f[B]-U\f[R], \f[B]--upscale=[i]\f[R]
\f[B]-U\f[R], \f[B]--upscale\f[R][=i]
Allow Upscaling.
If an image is smaller than the terminal size, scale it up to fit the
terminal.
Expand All @@ -263,7 +263,7 @@ that forces the upscaling to be in integer increments to keep the
`fuzzing'.
.RE
.TP
\f[B]--clear\f[R]
\f[B]--clear\f[R][=every]
Clear screen before \f[I]first\f[R] image.
This places the image at the top of the screen.
.RS
Expand Down Expand Up @@ -498,7 +498,9 @@ connection that can\[cq]t keep up with playing videos.
Or if you have a very slow CPU.
.SH EXAMPLES
Some example invocations including scrolling text or streaming an online
video are put together at <https://timg.sh/#examples>
video are put together at \c
.UR https://timg.sh/#examples
.UE \c
.PP
It might be useful to prepare some environment variables or aliases in
the startup profile of your shell.
Expand All @@ -520,12 +522,16 @@ display images on some limited text console.
The option \f[B]-V\f[R] should not be necessary for streaming video from
stdin; timg should internally buffer bytes it uses for probing.
.SH BUGS
Report bugs at <http://github.com/hzeller/timg/issues>
Report bugs at \c
.UR http://github.com/hzeller/timg/issues
.UE \c
.SH COPYRIGHT
Copyright (c) 2016..2023 Henner Zeller.
This program is free software, provided under the GNU GPL version 2.0.
.PP
<https://gnu.org/licenses/gpl-2.0.html>
\c
.UR https://gnu.org/licenses/gpl-2.0.html
.UE \c
.SH SEE ALSO
GraphicsMagick, ffmpeg(1), utf-8(7), unicode(7), kitty(1),
https://en.wikipedia.org/wiki/Sixel
Expand Down
8 changes: 4 additions & 4 deletions man/timg.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% timg(1)
% Henner Zeller
% Nov 2023
% Dec 2023

# NAME

Expand Down Expand Up @@ -113,7 +113,7 @@ Most likely commonly needed options first.
**-C**, **-\-center**
: Center image(s) and title(s) horizontally in their alotted space.

**-\-title=[format-string]**
**-\-title**[=&lt;*format-string*&gt;]
: Print title above each image. It is possible to customize the
title by giving a format string. In this string, the following format
specifiers are expanded:
Expand Down Expand Up @@ -207,7 +207,7 @@ Most likely commonly needed options first.
see the full picture.
Default behavior is to fit within the allotted width *and* height.

**-U**, **-\-upscale=[i]**
**-U**, **-\-upscale**[=i]
: Allow Upscaling. If an image is smaller than the terminal size, scale
it up to fit the terminal.

Expand All @@ -221,7 +221,7 @@ Most likely commonly needed options first.
that forces the upscaling to be in integer increments to keep the 'blocky'
appearance of an upscaled image without bilinear scale 'fuzzing'.

**-\-clear**
**-\-clear**[=every]
: Clear screen before *first* image. This places the image at the top of the
screen.

Expand Down
1 change: 1 addition & 0 deletions src/svg-image-source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ bool SVGImageSource::LoadAndScale(const DisplayOptions &opts, int, int) {
// the x-axis by 2 did not result in satisfactorial results, maybe due
// to rounding on an already heavily quantized size ? Let's just render
// in double resolution in both directions then manually scale down height.
// TODO: figure out how to get good low-res rendering without detour.
const int render_width = target_width;
const int render_height =
needs_x_double_resolution ? target_height * 2 : target_height;
Expand Down
Loading

0 comments on commit cb3691a

Please sign in to comment.