New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for crash when IPTC reading fails #316

Merged
merged 2 commits into from Mar 19, 2018

Conversation

2 participants
@IrvinDitz
Contributor

IrvinDitz commented Mar 16, 2018

Added try/except block around iptc_data.get to catch ImageFile exceptions.

@codecov

This comment has been minimized.

codecov bot commented Mar 16, 2018

Codecov Report

Merging #316 into master will increase coverage by 0.52%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
+ Coverage   87.28%   87.81%   +0.52%     
==========================================
  Files          19       19              
  Lines        1408     1411       +3     
==========================================
+ Hits         1229     1239      +10     
+ Misses        179      172       -7
Impacted Files Coverage Δ
sigal/gallery.py 88.7% <75%> (-0.16%) ⬇️
sigal/plugins/watermark.py 93.02% <0%> (+2.32%) ⬆️
sigal/plugins/compress_assets.py 100% <0%> (+8.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7841c5...802ebb7. Read the comment docs.

iptc_data = get_iptc_data(self.src_path)
except Exception as e:
self.logger.warning(u'Could not read IPTC data from %s: %s',
self.src_path, e)

This comment has been minimized.

@saimn

saimn Mar 18, 2018

Owner

Could you put the following in an else: block, to avoid having to check if iptc_data is defined ?
Also the codebase is now Python 3 only, so no need to use the u'...' prefix for strings.

This comment has been minimized.

@IrvinDitz

IrvinDitz Mar 19, 2018

Contributor

I've left u'' for string for now as all of them logger strings are like this in the gallery. We can update all of them at once in a separate commit.

This comment has been minimized.

@saimn

saimn Mar 19, 2018

Owner

Ok, seems reasonable, thanks for the quick update!

@saimn

This comment has been minimized.

Owner

saimn commented Mar 18, 2018

Thanks @IrvinDitz , looks good ! Can you just address the small comments above ?

@saimn

This comment has been minimized.

Owner

saimn commented Mar 18, 2018

@IrvinDitz - Can you also add yourself to the AUTHORS file ? Thanks.

@saimn saimn merged commit fbdd952 into saimn:master Mar 19, 2018

2 of 3 checks passed

codecov/patch 75% of diff hit (target 87.28%)
Details
codecov/project 87.81% (+0.52%) compared to a7841c5
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@saimn saimn added this to the 2.0 milestone Mar 19, 2018

@saimn saimn referenced this pull request Jun 18, 2018

Closed

Traceback on IPTC parsing #330

@saimn saimn referenced this pull request Aug 26, 2018

Closed

A couple of exif data bugs #335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment