2021-07-24 20:33:58 -07:00
|
|
|
#pragma warning disable CA1711, CS1591
|
2020-08-22 12:56:24 -07:00
|
|
|
|
2019-01-13 13:01:16 -07:00
|
|
|
using System;
|
2018-12-27 16:27:57 -07:00
|
|
|
using System.IO;
|
2019-01-13 12:25:32 -07:00
|
|
|
using MediaBrowser.Model.Drawing;
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
{
|
|
|
|
public class ImageStream : IDisposable
|
|
|
|
{
|
2021-05-22 15:20:19 -07:00
|
|
|
public ImageStream(Stream stream)
|
|
|
|
{
|
|
|
|
Stream = stream;
|
|
|
|
}
|
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <summary>
|
2021-05-22 15:20:19 -07:00
|
|
|
/// Gets the stream.
|
2018-12-27 16:27:57 -07:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The stream.</value>
|
2021-05-22 15:20:19 -07:00
|
|
|
public Stream Stream { get; }
|
2020-08-22 12:56:24 -07:00
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the format.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The format.</value>
|
|
|
|
public ImageFormat Format { get; set; }
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
2021-05-11 04:55:46 -07:00
|
|
|
Dispose(true);
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
{
|
|
|
|
if (disposing)
|
2018-12-27 16:27:57 -07:00
|
|
|
{
|
2021-05-11 04:55:46 -07:00
|
|
|
Stream?.Dispose();
|
2018-12-27 16:27:57 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|