Skip to content
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
Merged

Fix for crash when IPTC reading fails #316

merged 2 commits into from Mar 19, 2018

Conversation

@IrvinDitz
Copy link
Contributor

@IrvinDitz IrvinDitz commented Mar 16, 2018

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

@codecov
Copy link

@codecov 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
Author 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
Copy link
Owner

@saimn saimn commented Mar 18, 2018

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

@saimn
Copy link
Owner

@saimn 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
2 of 3 checks passed
@codecov
codecov/patch 75% of diff hit (target 87.28%)
Details
@codecov
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 mentioned this pull request Jun 18, 2018
@saimn saimn mentioned this pull request Aug 26, 2018
kontza pushed a commit to kontza/sigal that referenced this pull request Aug 28, 2020
Fix for crash when IPTC reading fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants