Skip to content

Commit a537587

Browse files
Ignore exceptions trying to read IPTC-IIM data
1 parent c853d26 commit a537587

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/TaglibSharp/Jpeg/File.cs

+8-4
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,14 @@ void ReadAPP13Segment (ushort length)
561561
}
562562
data.RemoveRange (0, iptc_iim_length + lenToSkip);
563563

564-
var reader = new IIM.IIMReader (data);
565-
var tag = reader.Process ();
566-
if (tag != null)
567-
ImageTag.AddTag (tag);
564+
try {
565+
var reader = new IIM.IIMReader (data);
566+
var tag = reader.Process ();
567+
if (tag != null)
568+
ImageTag.AddTag (tag);
569+
} catch (Exception) {
570+
// There isn't much we handle in the IPTC format, so we just ignore any errors.
571+
}
568572
}
569573

570574
/// <summary>

0 commit comments

Comments
 (0)