aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Drawing
diff options
context:
space:
mode:
authorPeter Maar <alset333@icloud.com>2020-03-19 22:02:08 -0400
committerGitHub <noreply@github.com>2020-03-19 22:02:08 -0400
commitadbf375efe44a5866a277ff2d7720c0ced6597b2 (patch)
treee89e50745ed8288b7bbd388018ed7669e449fee9 /MediaBrowser.Model/Drawing
parent818695a01e007ce507d4518aefc520870989964d (diff)
parentaf5d3e8eaeea6cd1c2e9248352a2e728d27b3c22 (diff)
Merge pull request #1 from jellyfin/master
Pull latest to my fork
Diffstat (limited to 'MediaBrowser.Model/Drawing')
-rw-r--r--MediaBrowser.Model/Drawing/DrawingUtils.cs16
-rw-r--r--MediaBrowser.Model/Drawing/ImageDimensions.cs35
-rw-r--r--MediaBrowser.Model/Drawing/ImageFormat.cs16
-rw-r--r--MediaBrowser.Model/Drawing/ImageOrientation.cs2
4 files changed, 42 insertions, 27 deletions
diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs
index 9fe85512f..0be30b0ba 100644
--- a/MediaBrowser.Model/Drawing/DrawingUtils.cs
+++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs
@@ -3,19 +3,19 @@ using System;
namespace MediaBrowser.Model.Drawing
{
/// <summary>
- /// Class DrawingUtils
+ /// Class DrawingUtils.
/// </summary>
public static class DrawingUtils
{
/// <summary>
- /// Resizes a set of dimensions
+ /// Resizes a set of dimensions.
/// </summary>
- /// <param name="size">The original size object</param>
- /// <param name="width">A new fixed width, if desired</param>
- /// <param name="height">A new fixed height, if desired</param>
- /// <param name="maxWidth">A max fixed width, if desired</param>
- /// <param name="maxHeight">A max fixed height, if desired</param>
- /// <returns>A new size object</returns>
+ /// <param name="size">The original size object.</param>
+ /// <param name="width">A new fixed width, if desired.</param>
+ /// <param name="height">A new fixed height, if desired.</param>
+ /// <param name="maxWidth">A max fixed width, if desired.</param>
+ /// <param name="maxHeight">A max fixed height, if desired.</param>
+ /// <returns>A new size object.</returns>
public static ImageDimensions Resize(ImageDimensions size,
int width,
int height,
diff --git a/MediaBrowser.Model/Drawing/ImageDimensions.cs b/MediaBrowser.Model/Drawing/ImageDimensions.cs
index e7805ac49..f84fe6830 100644
--- a/MediaBrowser.Model/Drawing/ImageDimensions.cs
+++ b/MediaBrowser.Model/Drawing/ImageDimensions.cs
@@ -1,36 +1,45 @@
+#pragma warning disable CS1591
+
+using System.Globalization;
+
namespace MediaBrowser.Model.Drawing
{
/// <summary>
- /// Struct ImageDimensions
+ /// Struct ImageDimensions.
/// </summary>
- public struct ImageDimensions
+ public readonly struct ImageDimensions
{
+ public ImageDimensions(int width, int height)
+ {
+ Width = width;
+ Height = height;
+ }
+
/// <summary>
- /// Gets or sets the height.
+ /// Gets the height.
/// </summary>
/// <value>The height.</value>
- public int Height { get; set; }
+ public int Height { get; }
/// <summary>
- /// Gets or sets the width.
+ /// Gets the width.
/// </summary>
/// <value>The width.</value>
- public int Width { get; set; }
+ public int Width { get; }
public bool Equals(ImageDimensions size)
{
return Width.Equals(size.Width) && Height.Equals(size.Height);
}
+ /// <inheritdoc />
public override string ToString()
{
- return string.Format("{0}-{1}", Width, Height);
- }
-
- public ImageDimensions(int width, int height)
- {
- Width = width;
- Height = height;
+ return string.Format(
+ CultureInfo.InvariantCulture,
+ "{0}-{1}",
+ Width,
+ Height);
}
}
}
diff --git a/MediaBrowser.Model/Drawing/ImageFormat.cs b/MediaBrowser.Model/Drawing/ImageFormat.cs
index 3639c1594..511c16a4e 100644
--- a/MediaBrowser.Model/Drawing/ImageFormat.cs
+++ b/MediaBrowser.Model/Drawing/ImageFormat.cs
@@ -1,28 +1,32 @@
namespace MediaBrowser.Model.Drawing
{
/// <summary>
- /// Enum ImageOutputFormat
+ /// Enum ImageOutputFormat.
/// </summary>
public enum ImageFormat
{
/// <summary>
- /// The BMP
+ /// The BMP.
/// </summary>
Bmp,
+
/// <summary>
- /// The GIF
+ /// The GIF.
/// </summary>
Gif,
+
/// <summary>
- /// The JPG
+ /// The JPG.
/// </summary>
Jpg,
+
/// <summary>
- /// The PNG
+ /// The PNG.
/// </summary>
Png,
+
/// <summary>
- /// The webp
+ /// The webp.
/// </summary>
Webp
}
diff --git a/MediaBrowser.Model/Drawing/ImageOrientation.cs b/MediaBrowser.Model/Drawing/ImageOrientation.cs
index 0fce8c3dc..5c78aea12 100644
--- a/MediaBrowser.Model/Drawing/ImageOrientation.cs
+++ b/MediaBrowser.Model/Drawing/ImageOrientation.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
namespace MediaBrowser.Model.Drawing
{
public enum ImageOrientation