timheuer / taglib-sharp-portable

.NET Portable Class Library implementation of TagLib# (forked from TagLib# main project)
Other
58 stars 33 forks source link

'Illegal characters in path.' exception in XmpTag.cs #8

Closed ttustonic closed 8 years ago

ttustonic commented 9 years ago

I get the 'Illegal characters in path.' exception when creating an instance of TagLib.Gif.File object for some GIF files in the samples directory. The exception comes from the line 268 in XmpTag.cs file. When I replace XDocument.Load(data) with XDocument.Parse(data) this exception goes away. However, a new exception, 'Cannot change named node' is raised in the ParseRDF function in line 302, when setting top.Name = attr.Value. The Name property setter in XmpNode.cs explicitly forbids changing a name field in the case of a non-null value, so it's unclear why is it written like this. Changing the line if (name != null) to if (!String.IsNullOrWhiteSpace(name)) seems to solve this.