This repository was archived by the owner on Sep 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 497
Resize quality improvements #796
Merged
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
96b966b
Refactor resizehelper to make things easier to read.
JimBobSquarePants c84d268
Update ImageFactory default.
JimBobSquarePants d823458
Fix tests
JimBobSquarePants 596db19
Fix coordinate assignment
JimBobSquarePants 621882b
Fix IndexOutOfRangeException in query string converters
5cc6711
Update QueryParamParser XML documentation
0e94029
Fix NullReferenceException in ResizeLayer.Equals and GetHashCode
2b02bb8
Revert CenterCoordinates to float[]
5bcaedc
Ignore empty/invalid center coordinates when comparing equality
9330324
Obsolete CenterCoordinates and use Center instead
0f5a672
Correctly swap center coordinates
9b8fc5c
Add nullable support to QueryParamParser.ParseValue
e1b931a
Fix parsing of center coordinates, add tests
d9cebb3
Merge branch 'develop' into js/resize-improvements
JimBobSquarePants File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.