-
Notifications
You must be signed in to change notification settings - Fork 171
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
Populate title & description from IPTC image data #297
Conversation
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 Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
@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 ? |
It’s my image (1.jpg and 2.jpg are the same image) and I’m happy to share it under an MIT licence.
…--
Edwin Steele e: edwin@wordspeak.org w: https://wordspeak.org
On 15 Feb 2018, 20:14 +1100, Simon Conseil ***@***.***>, wrote:
@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 ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Great, merging then, thanks! |
…from-iptc Populate title & description from IPTC image data
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