shithub: imgtools

Download patch

ref: 94794a38886af90b1af32cce3156db015f74339a
parent: a8fcdbe57c250d325d48563bf17886d85e13af42
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jan 20 09:32:38 EST 2021

resample: fix aspect-preserving scaling

--- a/resample.c
+++ b/resample.c
@@ -124,10 +124,10 @@
 		ih = h;
 	}
 
-	if(ow < 1)
+	if(ow == 0 && oh == 0){
 		ow = iw;
-	if(oh < 1)
 		oh = ih;
+	}
 	if(wp)
 		ow = iw*ow/100.0;
 	if(hp)