-
-
Notifications
You must be signed in to change notification settings - Fork 850
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
Add support for encoding and decoding IPTC metadata #1174
Conversation
{ | ||
Guard.NotNull(encoding, nameof(encoding)); | ||
|
||
if (!this.IsRepeatable(tag)) |
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.
@dlemstra i have changed the original code, so it is now possible to add some entrys more than once. If you think that would be useful for Magick.Net, too, i can change that over there, once this PR is done.
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.
Would be awesome if you could also get this merged into Magick.NET. Make sure you reference this issue then: dlemstra/Magick.NET#262. And maybe the API then also needs this: public IEnumerable<IptcValue> GetValues(IptcTag tag)
?
Codecov Report
@@ Coverage Diff @@
## master #1174 +/- ##
==========================================
+ Coverage 82.42% 82.47% +0.05%
==========================================
Files 684 687 +3
Lines 29564 29871 +307
Branches 3324 3378 +54
==========================================
+ Hits 24369 24637 +268
- Misses 4507 4534 +27
- Partials 688 700 +12
Continue to review full report at Codecov.
|
A thing i was unsure about was, if i should follow the specification strictly and cap some IPTC values accordingly. For example the Category should only be max 3 characters long according to the spec. Here is an overview of the tags with the max length ExifTool It seems no other tool which supports IPTC does honor those max length values, for example irfanview. |
…Value now returns a list of entrys instead of just one
I'm curious about all the values being strings. It looks to me that there are different value types in the specification. Perhaps we should refactor to allow safely using things like |
@brianpopow Do you mean writing as well as reading? I'd like to follow the spec for writing if possible. |
I mean only when the user adds new values to the profile. Enforcing the strict length rules would also prevent to write a app marker which exceeds the maximum length. |
If you look at page 32, |
@brianpopow How do you intend on enforcing that though? |
I'd consider that yes. Would it be hard to implement? |
No, i dont think its hard. The only think im unsure yet is how to deal with the datetime fields. |
/// </summary> | ||
/// <param name="tag">The tag of the iptc value.</param> | ||
/// <param name="dateTime">The datetime.</param> | ||
public void SetDateTimeValue(IptcTag tag, DateTime dateTime) |
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.
❤️
/// </summary> | ||
ReleaseDate = 30, | ||
|
||
/// <summary> | ||
/// Release time, not repeatable. | ||
/// Release time. Format should be HHMMSS±HHMM, | ||
/// e.g. "090000-0500" for 9 o'clock New York time (five hours behind UTC). |
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.
Use <example>
for block examples. Nest in summary to ensure they show up.
https://docs.microsoft.com/en-us/dotnet/csharp/codedoc#example
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.
Looks great; Well done!
Prerequisites
Description
This PR adds support for reading and writing IPTC metadata in JPEG files. The actual IPTC data parsing is kindly borrowed from Magick.Net.
Description of parsing APP13 Marker can be found here App13 Marker