Fix #440: new_width & new_height exception handling
Since the cos range is a real number range, there is a possibility of negative numbers. - handling fabs new_width & new_heightmaster
parent
d9157ebb08
commit
6653f3b535
|
@ -60,9 +60,9 @@ int main(int argc, char **arg)
|
|||
/* to radian */
|
||||
a2 = angle * .0174532925;
|
||||
|
||||
new_width = ceil(cos(a2) * gdImageSX(im)) +
|
||||
new_width = fabs(ceil(cos(a2) * gdImageSX(im))) +
|
||||
fabs(sin(a2) * gdImageSY(im));
|
||||
new_height = ceil(cos(a2) * gdImageSY(im)) +
|
||||
new_height = fabs(ceil(cos(a2) * gdImageSY(im))) +
|
||||
fabs(sin(a2) * gdImageSX(im));
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue