scale.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
scale.y=scale.x;
- *width=(unsigned long) floor(scale.x*former_width/100.0-0.5);
+ *width=(unsigned long) floor(scale.x*former_width/100.0+0.5);
if (*width == 0)
*width=1;
- *height=(unsigned long) floor(scale.y*former_height/100.0-0.5);
+ *height=(unsigned long) floor(scale.y*former_height/100.0+0.5);
if (*height == 0)
*height=1;
former_width=(*width);
scale_factor=(MagickRealType) *height/(MagickRealType)
former_width;
}
- *width=MagickMax((unsigned long) floor(scale_factor*former_width+0.5),
- 1UL);
- *height=MagickMax((unsigned long) floor(scale_factor*former_height+0.5),
- 1UL);
+ *width=MagickMax((unsigned long) floor(scale_factor*former_width+0.5),1UL);
+ *height=MagickMax((unsigned long) floor(scale_factor*former_height+0.5),1UL);
}
if ((flags & GreaterValue) != 0)
{
return(resize_filter->cubic[0]+x*(resize_filter->cubic[1]+x*
(resize_filter->cubic[2]+x*resize_filter->cubic[3])));
if (x < 2.0)
- return(resize_filter->cubic[4] +x*(resize_filter->cubic[5]+x*
+ return(resize_filter->cubic[4]+x*(resize_filter->cubic[5]+x*
(resize_filter->cubic[6] +x*resize_filter->cubic[7])));
return(0.0);
}
if (status == MagickFalse)
continue;
center=(MagickRealType) (x+0.5)/x_factor;
- start=(long) ceil(MagickMax(center-support-MagickEpsilon,0.0)-0.5);
- stop=(long) floor(MagickMin(center+support,(double) image->columns)+0.5);
+ start=(long) MagickMax(center-support+0.5,0.0);
+ stop=(long) MagickMin(center+support+0.5,(double) image->columns);
density=0.0;
contribution=contributions[GetOpenMPThreadId()];
for (n=0; n < (stop-start); n++)
if (status == MagickFalse)
continue;
- center=(MagickRealType) (y-0.5)/y_factor;
- start=(long) ceil(MagickMax(center-support-MagickEpsilon,0.0)-0.5);
- stop=(long) floor(MagickMin(center+support,(double) image->rows)+0.5);
+ center=(MagickRealType) (y+0.5)/y_factor;
+ start=(long) MagickMax(center-support+0.5,0.0);
+ stop=(long) MagickMin(center+support+0.5,(double) image->rows);
density=0.0;
contribution=contributions[GetOpenMPThreadId()];
for (n=0; n < (stop-start); n++)
if (status == MagickFalse)
continue;
- y_offset=(long) ceil(((MagickRealType) y-0.5)*image->rows/
- sample_image->rows);
+ y_offset=(long) (((MagickRealType) y+0.5)*image->rows/sample_image->rows);
p=GetCacheViewVirtualPixels(image_view,0,y_offset,image->columns,1,
exception);
q=QueueCacheViewAuthenticPixels(sample_view,0,y,sample_image->columns,1,