12345678910111213141516171819202122232425 |
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Reflection;
- using Masuit.Tools.Mime;
- namespace Masuit.Tools.Files.FileDetector.Detectors;
- [FormatCategory(FormatCategory.Image)]
- internal sealed class Jpeg2000Detector : AbstractSignatureDetector
- {
- private static readonly SignatureInformation[] JpegSignatureInfo = {
- new() { Position = 0, Signature = new byte [] { 0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20 } },
- };
- public override string Extension => "jp2";
- protected override SignatureInformation[] SignatureInformations => JpegSignatureInfo;
- public override string MimeType => new MimeMapper().GetMimeFromExtension("." + Extension);
- public override List<FormatCategory> FormatCategories => GetType().GetCustomAttributes<FormatCategoryAttribute>().Select(a => a.Category).ToList();
- public override string ToString() => "JPEG2000 Detector";
- }
|