Attempt to circumvent "OSError: image file is truncated" issue. #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
as detailed here: python-pillow/Pillow#1510
When running the management command 'rendervariations' on a set of about 100.000 images, I bumped into the error message:
image file is truncated (6 bytes not processed)
, which came form PIL that bumped into a faulty image (See PIL/ImageFile.py, line 232). The complete rendering stopped.The exception isn't caught anywhere. I think ideally one wants a setting to control what to do on such a failure: skip, continue, halt...
For now I followed the suggestion as outlined in referenced Pillow issue, which solved the problem for me. See the changes in stdimage/models.py.
Btw: I tried following the contribution guide, but when i do a
dcc django-stdimage
, I get this error message:So I offer this PR as a suggestion to fix the issue, but I suppose there are better ways.