From 06971d99a0bf6c9d2d05dcc0cd4045c2a4d4b363 Mon Sep 17 00:00:00 2001
From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org>
Date: Tue, 10 Feb 1998 14:28:18 +0100
Subject: [PATCH] scale to 1x1 as smallest

Rev: src/modules/Image/matrix.c:1.15
---
 src/modules/Image/matrix.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/modules/Image/matrix.c b/src/modules/Image/matrix.c
index 9a2807944c..0ff96d97a4 100644
--- a/src/modules/Image/matrix.c
+++ b/src/modules/Image/matrix.c
@@ -1,9 +1,9 @@
-/* $Id: matrix.c,v 1.14 1998/01/16 22:09:12 grubba Exp $ */
+/* $Id: matrix.c,v 1.15 1998/02/10 13:28:18 mirar Exp $ */
 
 /*
 **! module Image
 **! note
-**!	$Id: matrix.c,v 1.14 1998/01/16 22:09:12 grubba Exp $
+**!	$Id: matrix.c,v 1.15 1998/02/10 13:28:18 mirar Exp $
 **! class image
 */
 
@@ -169,7 +169,9 @@ CHRONO("scale begin");
 
    if (dest->img) { free(dest->img); dest->img=NULL; }
 
-   if (!THIS->img || newx<=0 || newy<=0) return; /* no way */
+   if (!THIS->img) return; /* no way */
+   if (newx<1) newx=1;
+   if (newy<1) newy=1;
 
    new=malloc(newx*newy*sizeof(rgbd_group) +1);
    if (!new) error("Out of memory!\n");
@@ -293,6 +295,8 @@ void img_scale2(struct image *dest, struct image *source)
 **! arg int newysize
 **!	new image size in pixels
 **!
+**! note
+**!     resulting image will be 1x1 pixels, at least
 */
 
 void image_scale(INT32 args)
-- 
GitLab