question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images min dimensions cause unhandled exception

See original GitHub issue

When I enable in settings.py IMAGES_MIN_HEIGHT = 350 IMAGES_MIN_WIDTH = 350

I start getting unhandled exceptions:

Unhandled error in Deferred: Failure: scrapy.pipelines.images.ImageException: Image too small (62x59 < 350x350)

The exception looks like this:

2017-05-28 19:06:43 [scrapy.pipelines.files] WARNING: File (error): Error processing file from <GET http://example.com/images/0.jpg> referred in <http://www.example.com/>: Image too small (600x200 < 350x350)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/scrapy/pipelines/files.py", line 356, in media_downloaded
    checksum = self.file_downloaded(response, request, info)
  File "/usr/lib/python2.7/dist-packages/scrapy/pipelines/images.py", line 98, in file_downloaded
    return self.image_downloaded(response, request, info)
  File "/usr/lib/python2.7/dist-packages/scrapy/pipelines/images.py", line 102, in image_downloaded
    for path, image, buf in self.get_images(response, request, info):
  File "/usr/lib/python2.7/dist-packages/scrapy/pipelines/images.py", line 120, in get_images
    (width, height, self.min_width, self.min_height))
ImageException: Image too small (600x200 < 350x350)

When I comment except statements: https://github.com/scrapy/scrapy/blob/1.3/scrapy/pipelines/files.py#L364 https://github.com/scrapy/scrapy/blob/1.3/scrapy/pipelines/files.py#L372 the exceptions aren’t unhandled anymore.

It seems to me like a bug. Isn’t is? Or am I doing something wrong?

It may be something similar to: https://github.com/scrapy/scrapy/issues/1884 but in my case scrapy really crashes

python-w3lib: 1.17.0-1~exp1 python-scrapy: 1.3.3-1~exp1 both from a debian package Python 2.7.10+

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Gallaeciocommented, Jan 10, 2020

It is not obvious to me, that second issue about two images escaping your size rules. Could you open a separate ticket about that? It would be great if you could include in that ticket a minimal spider to reproduce the issue.

0reactions
MihaiWillcommented, Jan 10, 2020

It is not obvious to me, that second issue about two images escaping your size rules. Could you open a separate ticket about that? It would be great if you could include in that ticket a minimal spider to reproduce the issue.

I cannot reproduce anymore, so is fine now,maybe it was a human error from my part. So it works as it should, it just log the traceback. Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception Unhandled Error Scanning an Image with OpenCV ...
This error occurs at line 1107 in OpenCV's mat.inl.hpp file. During debugging I have stepped through the code and figured out that the...
Read more >
"Fatal Error: Unhandled Exception" - Gimp-Forum.net
Ever since a few months ago, I've had this issue where the two functions: saving a file and using the scale tool take...
Read more >
Common Flutter errors
Introduction. This page explains several frequently-encountered Flutter framework errors and gives suggestions on how to resolve them.
Read more >
BA101 Unhandled exception in the Windows Imaging Engine
Unhandled exceptions are usually related to the back end of BackupAssist and may require the assistance of BackupAssist Technical support.
Read more >
Checking image size in C++ - Code Review Stack Exchange
... if an unhandled exception is thrown, it prints the what() but no line number, so nothing is lost by putting the throw...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found