aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Drawing
diff options
context:
space:
mode:
authorLuke Foust <luke@foust.com>2020-03-20 12:53:52 -0700
committerGitHub <noreply@github.com>2020-03-20 12:53:52 -0700
commitdcd0d93f44bf1befea5e61993bc868b5846102a0 (patch)
tree740f132fce52947fc8a73621588ca36c3447922a /MediaBrowser.Model/Drawing
parent80dfc78ba5ec3895fd374a5bd761d0d0e9e6a862 (diff)
parente028fb6fdefa6120fc6109c63d883d21412c31bd (diff)
Merge pull request #1 from jellyfin/master
merge with upstream master
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