4 Jan
2002
4 Jan
'02
7:21 a.m.
* J M Cerqueira Esteves <jmce@artenumerica.com> [2002-01-04 06:40 +0000]:
while Photo uses (with integer division, therefore with truncation everywhere):
if hM > h0 * wM / w0: height = h0 * wM / w0 width = wM else: height = hM width = w0 * hM / w0
... which by the way has idempotency problems. In my example, a 272×281 pic allowed to have wM=480 and hM=480, this gives 464×480 as dimensions respecting the original aspect ratio. But if one specifies (wM, hM)=(464,480) and starts again with 272×281, the final result is then (464, 479) instead of the expected (464,480)...