2021-07-25 03:33:58 +00:00
|
|
|
#pragma warning disable CA1711, CS1591
|
2020-08-22 19:56:24 +00:00
|
|
|
|
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
|
|
|
|
{
|
2021-05-22 22:20:19 +00:00
|
|
|
public ImageStream(Stream stream)
|
|
|
|
{
|
|
|
|
Stream = stream;
|
|
|
|
}
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
2021-05-22 22:20:19 +00:00
|
|
|
/// Gets the stream.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The stream.</value>
|
2021-05-22 22:20:19 +00:00
|
|
|
public Stream Stream { get; }
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|