diff options
-rw-r--r-- | grunge.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/grunge.cpp b/grunge.cpp index 2f6783c..af5da13 100644 --- a/grunge.cpp +++ b/grunge.cpp | |||
@@ -243,7 +243,7 @@ Magick::Image grunge::getImageForNoun(verbly::word pictured) const | |||
243 | { | 243 | { |
244 | pic.read(img); | 244 | pic.read(img); |
245 | 245 | ||
246 | if ((pic.rows() > 0) && (pic.columns() >= 800)) | 246 | if (pic.rows() > 0) |
247 | { | 247 | { |
248 | std::cout << url << std::endl; | 248 | std::cout << url << std::endl; |
249 | found = true; | 249 | found = true; |
@@ -265,6 +265,16 @@ Magick::Image grunge::getImageForNoun(verbly::word pictured) const | |||
265 | 265 | ||
266 | Magick::Image grunge::pixelateImage(Magick::Image image) const | 266 | Magick::Image grunge::pixelateImage(Magick::Image image) const |
267 | { | 267 | { |
268 | // Check that the image is at least 800 pixels in width. | ||
269 | if (image.columns() < 800) | ||
270 | { | ||
271 | Magick::Geometry blownUp( | ||
272 | 800, | ||
273 | image.rows() * 800 / image.columns()); | ||
274 | |||
275 | image.zoom(blownUp); | ||
276 | } | ||
277 | |||
268 | // Check that the image dimensions are a multiple of four. | 278 | // Check that the image dimensions are a multiple of four. |
269 | if ((image.rows() % 4 != 0) || (image.columns() % 4 != 0)) | 279 | if ((image.rows() % 4 != 0) || (image.columns() % 4 != 0)) |
270 | { | 280 | { |