jellyfin-server/MediaBrowser.Controller/Drawing/ImageStream.cs

43 lines
903 B
C#
Raw Normal View History

#pragma warning disable CA1711, CS1591
using System;
2018-12-27 23:27:57 +00:00
using System.IO;
using MediaBrowser.Model.Drawing;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Controller.Drawing
{
public class ImageStream : IDisposable
{
public ImageStream(Stream stream)
{
Stream = stream;
}
2018-12-27 23:27:57 +00:00
/// <summary>
/// Gets the stream.
2018-12-27 23:27:57 +00:00
/// </summary>
/// <value>The stream.</value>
public Stream Stream { get; }
2018-12-27 23:27:57 +00:00
/// <summary>
/// Gets or sets the format.
/// </summary>
/// <value>The format.</value>
public ImageFormat Format { get; set; }
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
2018-12-27 23:27:57 +00:00
{
Stream?.Dispose();
2018-12-27 23:27:57 +00:00
}
}
}
}