else {
y_ratio = x_ratio;
}
- dest_width = org_width / x_ratio;
- dest_height = org_height / y_ratio;
+ dest_width = (int)(org_width / x_ratio);
+ dest_height = (int)(org_height / y_ratio);
}
else {
x_ratio = (float) dest_width / (float) org_width;
else {
y_ratio = x_ratio;
}
- dest_width = org_width * x_ratio;
- dest_height = org_height * y_ratio;
+ dest_width = (int)(org_width * x_ratio);
+ dest_height = (int)(org_height * y_ratio);
}
im_tmp = gdImageCreate (dest_width, dest_height);