Skip to content

Commit

Permalink
Ignore exceptions trying to read IPTC-IIM data
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenMcConnel committed Nov 9, 2023
1 parent c853d26 commit a537587
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/TaglibSharp/Jpeg/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,14 @@ void ReadAPP13Segment (ushort length)
}
data.RemoveRange (0, iptc_iim_length + lenToSkip);

var reader = new IIM.IIMReader (data);
var tag = reader.Process ();
if (tag != null)
ImageTag.AddTag (tag);
try {
var reader = new IIM.IIMReader (data);
var tag = reader.Process ();
if (tag != null)
ImageTag.AddTag (tag);
} catch (Exception) {
// There isn't much we handle in the IPTC format, so we just ignore any errors.
}
}

/// <summary>
Expand Down

0 comments on commit a537587

Please sign in to comment.