| 2195 | | resize_image=CloneImage(image,columns,rows,MagickTrue,exception); |
| 2196 | | if (resize_image == (Image *) NULL) |
| 2197 | | return((Image *) NULL); |
| 2198 | | /* |
| 2199 | | Scaling, Acquire filter, and contribution info |
| 2200 | | */ |
| 2201 | | x_factor=(MagickRealType) resize_image->columns/(MagickRealType) |
| 2202 | | image->columns; |
| 2203 | | y_factor=(MagickRealType) resize_image->rows/(MagickRealType) image->rows; |
| | 2195 | x_factor=(MagickRealType) columns/(MagickRealType) image->columns; |
| | 2196 | y_factor=(MagickRealType) rows/(MagickRealType) image->rows; |
| 2220 | | if ((columns*((MagickSizeType) image->rows+rows)) > |
| 2221 | | (rows*((MagickSizeType) image->columns+columns))) |
| 2222 | | { |
| 2223 | | filter_image=CloneImage(image,columns,image->rows,MagickTrue,exception); |
| 2224 | | if (filter_image == (Image *) NULL) |
| 2225 | | { |
| 2226 | | resize_image=DestroyImage(resize_image); |
| 2227 | | resize_filter=DestroyResizeFilter(resize_filter); |
| 2228 | | return((Image *) NULL); |
| 2229 | | } |
| 2230 | | span=(MagickSizeType) (filter_image->columns+resize_image->rows); |
| 2231 | | status=HorizontalFilter(resize_filter,image,filter_image,x_factor,span, |
| 2232 | | &quantum,exception); |
| 2233 | | status|=VerticalFilter(resize_filter,filter_image,resize_image,y_factor, |
| 2234 | | span,&quantum,exception); |
| 2235 | | } |
| 2236 | | else |
| 2237 | | { |
| 2238 | | filter_image=CloneImage(image,image->columns,rows,MagickTrue,exception); |
| 2239 | | if (filter_image == (Image *) NULL) |
| 2240 | | { |
| 2241 | | resize_image=DestroyImage(resize_image); |
| 2242 | | resize_filter=DestroyResizeFilter(resize_filter); |
| 2243 | | return((Image *) NULL); |
| 2244 | | } |
| 2245 | | span=(MagickSizeType) (resize_image->columns+filter_image->rows); |
| 2246 | | status=VerticalFilter(resize_filter,image,filter_image,y_factor,span, |
| 2247 | | &quantum,exception); |
| 2248 | | status|=HorizontalFilter(resize_filter,filter_image,resize_image,x_factor, |
| 2249 | | span,&quantum,exception); |
| 2250 | | } |
| | 2220 | status=HorizontalFilter(resize_filter,image,filter_image,x_factor,span, |
| | 2221 | &quantum,exception); |
| | 2222 | resize_image=CloneImage(image,columns,rows,MagickTrue,exception); |
| | 2223 | if (resize_image == (Image *) NULL) |
| | 2224 | { |
| | 2225 | filter_image=DestroyImage(filter_image); |
| | 2226 | resize_filter=DestroyResizeFilter(resize_filter); |
| | 2227 | return((Image *) NULL); |
| | 2228 | } |
| | 2229 | status|=VerticalFilter(resize_filter,filter_image,resize_image,y_factor,span, |
| | 2230 | &quantum,exception); |