2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.IO;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Model.Drawing;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
{
|
|
|
|
public class ImageStream : IDisposable
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the stream.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The stream.</value>
|
2021-05-06 22:39:20 +00:00
|
|
|
public Stream? Stream { get; set; }
|
2020-08-22 19:56:24 +00:00
|
|
|
|
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()
|
|
|
|
{
|
2021-05-11 11:55:46 +00:00
|
|
|
Dispose(true);
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
{
|
|
|
|
if (disposing)
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
2021-05-11 11:55:46 +00:00
|
|
|
Stream?.Dispose();
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|