Skip Menu |

This queue is for tickets about the Image-Resize CPAN distribution.

Report information
The Basics
Id: 120019
Status: new
Priority: 0/
Queue: Image-Resize

People
Owner: Nobody in particular
Requestors: schwiege [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: rounding error in resize
Date: Sat, 28 Jan 2017 19:44:36 +0000
To: bug-Image-Resize [...] rt.cpan.org
From: Mischa <schwiege [...] gmx.net>
The constraint height and width is calculated without properly rounding the numbers. That can lead to unexpected results, e.g. requesting 128 but getting 127. The error seems to be in line 47 / 48 $height = int($self->height * $k); $width = int($self->width * $k); which should be imo $height = int( $self->height * $k + .5 ); $width = int( $self->width * $k + .5 );