This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository legacy-imlib2.
View the commit online.
commit cf926c746cd3dfe4bfa5ad8fd5bff075d2efce84
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Tue Aug 8 20:08:09 2023 +0200
imlib2_view: Enable specifying border
The border is applied during input scaling.
The output scaling scales the whole image as rendered by the input
scaling.
---
src/bin/imlib2_view.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/bin/imlib2_view.c b/src/bin/imlib2_view.c
index 1e9b0ec..17ca47d 100644
--- a/src/bin/imlib2_view.c
+++ b/src/bin/imlib2_view.c
@@ -31,6 +31,7 @@ static Imlib_Image bg_im = NULL;
static Imlib_Image bg_im_clean = NULL;
static Imlib_Image fg_im = NULL; /* The animated image */
static Imlib_Image im_curr = NULL; /* The current image */
+static Imlib_Border border;
static bool opt_cache = false;
static bool opt_progr = true; /* Render through progress callback */
@@ -69,6 +70,7 @@ static int animloop = 0; /* Animation loop count */
" imlib2_view [OPTIONS] {FILE | XID}...\n" \
"OPTIONS:\n" \
" -a : Disable final anti-aliased rendering\n" \
+ " -b L,R,T,B : Set border\n" \
" -c : Enable image caching (implies -e)\n" \
" -d : Enable debug\n" \
" -e : Do rendering explicitly (not via progress callback)\n" \
@@ -364,6 +366,8 @@ progress(Imlib_Image im, char percent, int update_x, int update_y,
/* first time it's called */
if (image_width == 0)
{
+ imlib_image_set_border(&border);
+
scale_x = opt_sc_out_x;
scale_y = opt_sc_out_y;
@@ -622,13 +626,18 @@ main(int argc, char **argv)
verbose = 0;
- while ((opt = getopt(argc, argv, "acdeg:l:ps:S:t:v")) != -1)
+ while ((opt = getopt(argc, argv, "ab:cdeg:l:ps:S:t:v")) != -1)
{
switch (opt)
{
case 'a':
opt_aa_final = false;
break;
+ case 'b':
+ border.left = border.right = border.top = border.bottom = 0;
+ sscanf(optarg, "%d,%d,%d,%d",
+ &border.left, &border.right, &border.top, &border.bottom);
+ break;
case 'c':
opt_cache = true;
opt_progr = false; /* Cached images won't give progress callbacks */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.