aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Drawing/DrawingUtils.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-08 16:09:53 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-08 16:09:53 -0400
commitf02c3260273a09f465c4e7a97d8b90f0f6909734 (patch)
tree180760af62fcddc1964e000c6c57bd368dce836d /MediaBrowser.Model/Drawing/DrawingUtils.cs
parent374dd8d44152e49f4616a9c8c3d36e8793ed037e (diff)
Removed guids from the model project
Diffstat (limited to 'MediaBrowser.Model/Drawing/DrawingUtils.cs')
-rw-r--r--MediaBrowser.Model/Drawing/DrawingUtils.cs35
1 files changed, 27 insertions, 8 deletions
diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs
index e95b5e375..ae483b6f6 100644
--- a/MediaBrowser.Model/Drawing/DrawingUtils.cs
+++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs
@@ -16,7 +16,12 @@ namespace MediaBrowser.Model.Drawing
/// <returns>ImageSize.</returns>
public static ImageSize Scale(double currentWidth, double currentHeight, double scaleFactor)
{
- return Scale(new ImageSize { Width = currentWidth, Height = currentHeight }, scaleFactor);
+ return Scale(new ImageSize
+ {
+ Width = currentWidth,
+ Height = currentHeight
+
+ }, scaleFactor);
}
/// <summary>
@@ -29,7 +34,7 @@ namespace MediaBrowser.Model.Drawing
{
var newWidth = size.Width * scaleFactor;
- return Resize(size.Width, size.Height, newWidth);
+ return Resize(size.Width, size.Height, newWidth, null, null, null);
}
/// <summary>
@@ -42,9 +47,19 @@ namespace MediaBrowser.Model.Drawing
/// <param name="maxWidth">A max fixed width, if desired</param>
/// <param name="maxHeight">A max fixed height, if desired</param>
/// <returns>ImageSize.</returns>
- public static ImageSize Resize(double currentWidth, double currentHeight, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null)
+ public static ImageSize Resize(double currentWidth,
+ double currentHeight,
+ double? width,
+ double? height,
+ double? maxWidth,
+ double? maxHeight)
{
- return Resize(new ImageSize { Width = currentWidth, Height = currentHeight }, width, height, maxWidth, maxHeight);
+ return Resize(new ImageSize
+ {
+ Width = currentWidth,
+ Height = currentHeight
+
+ }, width, height, maxWidth, maxHeight);
}
/// <summary>
@@ -56,7 +71,11 @@ namespace MediaBrowser.Model.Drawing
/// <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 ImageSize Resize(ImageSize size, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null)
+ public static ImageSize Resize(ImageSize size,
+ double? width,
+ double? height,
+ double? maxWidth,
+ double? maxHeight)
{
double newWidth = size.Width;
double newHeight = size.Height;
@@ -79,13 +98,13 @@ namespace MediaBrowser.Model.Drawing
newWidth = width.Value;
}
- if (maxHeight.HasValue && maxHeight < newHeight)
+ if (maxHeight.HasValue && maxHeight.Value < newHeight)
{
newWidth = GetNewWidth(newHeight, newWidth, maxHeight.Value);
newHeight = maxHeight.Value;
}
- if (maxWidth.HasValue && maxWidth < newWidth)
+ if (maxWidth.HasValue && maxWidth.Value < newWidth)
{
newHeight = GetNewHeight(newHeight, newWidth, maxWidth.Value);
newWidth = maxWidth.Value;
@@ -186,7 +205,7 @@ namespace MediaBrowser.Model.Drawing
{
if (!string.IsNullOrEmpty(value))
{
- var parts = value.Split('-');
+ string[] parts = value.Split('-');
if (parts.Length == 2)
{