NullImageEncoder.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using MediaBrowser.Controller.Drawing;
  4. using MediaBrowser.Model.Drawing;
  5. namespace Jellyfin.Drawing;
  6. /// <summary>
  7. /// A fallback implementation of <see cref="IImageEncoder" />.
  8. /// </summary>
  9. public class NullImageEncoder : IImageEncoder
  10. {
  11. /// <inheritdoc />
  12. public IReadOnlyCollection<string> SupportedInputFormats
  13. => new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "png", "jpeg", "jpg" };
  14. /// <inheritdoc />
  15. public IReadOnlyCollection<ImageFormat> SupportedOutputFormats
  16. => new HashSet<ImageFormat>() { ImageFormat.Jpg, ImageFormat.Png };
  17. /// <inheritdoc />
  18. public string Name => "Null Image Encoder";
  19. /// <inheritdoc />
  20. public bool SupportsImageCollageCreation => false;
  21. /// <inheritdoc />
  22. public bool SupportsImageEncoding => false;
  23. /// <inheritdoc />
  24. public ImageDimensions GetImageSize(string path)
  25. => throw new NotImplementedException();
  26. /// <inheritdoc />
  27. public string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat outputFormat)
  28. {
  29. throw new NotImplementedException();
  30. }
  31. /// <inheritdoc />
  32. public void CreateImageCollage(ImageCollageOptions options, string? libraryName)
  33. {
  34. throw new NotImplementedException();
  35. }
  36. /// <inheritdoc />
  37. public void CreateSplashscreen(IReadOnlyList<string> posters, IReadOnlyList<string> backdrops)
  38. {
  39. throw new NotImplementedException();
  40. }
  41. /// <inheritdoc />
  42. public int CreateTrickplayTile(ImageCollageOptions options, int quality, int imgWidth, int? imgHeight)
  43. {
  44. throw new NotImplementedException();
  45. }
  46. /// <inheritdoc />
  47. public string GetImageBlurHash(int xComp, int yComp, string path)
  48. {
  49. throw new NotImplementedException();
  50. }
  51. }