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

Populate title & description from IPTC image data #297

Merged
merged 2 commits into from
Feb 15, 2018

Conversation

edwinsteele
Copy link
Contributor

The IPTC spec defines title and description fields so use those
to populate these fields on the Image unless they've been set by
some other means, thus preserving existing behaviour.

This provides a pattern that could be used with #249

The IPTC spec defines title and description fields so use those
to populate these fields on the Image unless they've been set by
some other means.
@codecov
Copy link

codecov bot commented Feb 13, 2018

Codecov Report

Merging #297 into master will increase coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
+ Coverage   87.48%   87.65%   +0.17%     
==========================================
  Files          19       19              
  Lines        1358     1377      +19     
==========================================
+ Hits         1188     1207      +19     
  Misses        170      170
Impacted Files Coverage Δ
sigal/image.py 94.55% <100%> (+0.28%) ⬆️
sigal/gallery.py 88.2% <100%> (+0.25%) ⬆️

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 9004843...45cf226. Read the comment docs.

Copy link
Owner

@saimn saimn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small comment, otherwise it looks great, thanks!

sigal/gallery.py Outdated
if iptc_data and not self.description:
# 2:120 is the IPTC description property
if (2, 120) in iptc_data:
self.description = iptc_data[(2, 120)].decode('utf-8')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could put the details of how to get title and description in get_iptc_data, it would make the function easier to test and more self-contained, and avoid to do this directly in Image which does not have to know how IPTC work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

@saimn
Copy link
Owner

saimn commented Feb 15, 2018

@edwinsteele - What is the license of the images ? If you are the author of these images, do you agree do share them with sigal's license ?

@edwinsteele
Copy link
Contributor Author

edwinsteele commented Feb 15, 2018 via email

@saimn
Copy link
Owner

saimn commented Feb 15, 2018

Great, merging then, thanks!

@saimn saimn merged commit c2cdb22 into saimn:master Feb 15, 2018
@saimn saimn added this to the 1.4 milestone Feb 17, 2018
@edwinsteele edwinsteele deleted the feature/get-title-desc-from-iptc branch October 1, 2018 00:44
kontza pushed a commit to kontza/sigal that referenced this pull request Aug 28, 2020
…from-iptc

Populate title & description from IPTC image data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants