drewnoakes / metadata-extractor-dotnet

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Other
922 stars 164 forks source link

Spanify various things and use UTF-8 literals #361

Closed iamcarbon closed 7 months ago

iamcarbon commented 7 months ago

Posting for early feedback.

There is one public API change, which I'm happy to revert if we have a no-breaking changes policy.

protected byte[] PreambleBytes was changed to protected ReadOnlySpan<byte> PreambleBytes

This also prevents the mutation of the underlying data.

iamcarbon commented 7 months ago

@drewnoakes Ready for review.

drewnoakes commented 7 months ago

Thanks @iamcarbon this is great. I've started spanifying a few things locally too, though we don't have much overlap which is great. I'm looking mostly at the deserialization stuff, using BinaryPrimitives rather than hand-rolled functions. The built-in ones will be faster.

There is one public API change

I think that's fine, as it's not an API I'd expect many to use directly (if any), though I'm surprised it didn't require a change to the API files.