This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #796 from JimBobSquarePants/js/resize-improvements
Resize quality improvements
- Loading branch information
Showing
20 changed files
with
715 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/ImageProcessor.Web/Helpers/QuerystringParser/Converters/PointFConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="PointConverter.cs" company="James Jackson-South"> | ||
// Copyright (c) James Jackson-South. | ||
// Licensed under the Apache License, Version 2.0. | ||
// </copyright> | ||
// <summary> | ||
// The point converter. | ||
// </summary> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace ImageProcessor.Web.Helpers | ||
{ | ||
using System; | ||
using System.Drawing; | ||
using System.Globalization; | ||
|
||
/// <summary> | ||
/// The PointF converter. | ||
/// </summary> | ||
public class PointFConverter : GenericArrayTypeConverter<float> | ||
{ | ||
/// <summary> | ||
/// Converts the given object to the type of this converter, using the specified context and culture | ||
/// information. | ||
/// </summary> | ||
/// <returns> | ||
/// An <see cref="T:System.Object"/> that represents the converted value. | ||
/// </returns> | ||
/// <param name="culture"> | ||
/// The <see cref="T:System.Globalization.CultureInfo"/> to use as the current culture. | ||
/// </param> | ||
/// <param name="value">The <see cref="T:System.Object"/> to convert. </param> | ||
/// <param name="propertyType">The property type that the converter will convert to.</param> | ||
/// <exception cref="T:System.NotSupportedException">The conversion cannot be performed.</exception> | ||
public override object ConvertFrom(CultureInfo culture, object value, Type propertyType) | ||
{ | ||
object result = base.ConvertFrom(culture, value, propertyType); | ||
|
||
return result is float[] list && list.Length == 2 ? new PointF(list[0], list[1]) : result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.