diff options
Diffstat (limited to 'advice.cpp')
-rw-r--r-- | advice.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/advice.cpp b/advice.cpp index 11a5d65..f635a12 100644 --- a/advice.cpp +++ b/advice.cpp | |||
@@ -180,20 +180,21 @@ void advice::run() const | |||
180 | 180 | ||
181 | std::string imgstr = imgbuf.str(); | 181 | std::string imgstr = imgbuf.str(); |
182 | img = Magick::Blob(imgstr.c_str(), imgstr.length()); | 182 | img = Magick::Blob(imgstr.c_str(), imgstr.length()); |
183 | pic.read(img); | 183 | |
184 | if (pic.rows() == 0) | 184 | try |
185 | { | 185 | { |
186 | continue; | 186 | pic.read(img); |
187 | } | ||
188 | 187 | ||
189 | // Too small! | 188 | if ((pic.rows() > 0) && (pic.columns() >= 400)) |
190 | if (pic.columns() < 400) | 189 | { |
190 | std::cout << url << std::endl; | ||
191 | found = true; | ||
192 | } | ||
193 | } catch (const Magick::ErrorOption& e) | ||
191 | { | 194 | { |
192 | continue; | 195 | // Occurs when the the data downloaded from the server is malformed |
196 | std::cout << "Magick: " << e.what() << std::endl; | ||
193 | } | 197 | } |
194 | |||
195 | std::cout << url << std::endl; | ||
196 | found = true; | ||
197 | } | 198 | } |
198 | 199 | ||
199 | if (!found) | 200 | if (!found) |