diff --git a/ShareX.HelpersLib/Helpers/ImageHelpers.cs b/ShareX.HelpersLib/Helpers/ImageHelpers.cs
index 8a575a185..8bf2d0380 100644
--- a/ShareX.HelpersLib/Helpers/ImageHelpers.cs
+++ b/ShareX.HelpersLib/Helpers/ImageHelpers.cs
@@ -183,13 +183,21 @@ public static Image ResizeImageLimit(Image img, int width, int height)
double ratioX = (double)width / img.Width;
double ratioY = (double)height / img.Height;
- double ratio = ratioX < ratioY ? ratioX : ratioY;
- int newWidth = (int)(img.Width * ratio);
- int newHeight = (int)(img.Height * ratio);
+ int newWidth = width;
+ int newHeight = height;
+ if (ratioX < ratioY)
+ newHeight = (int)(img.Height * ratioX);
+ else
+ newWidth = (int)(img.Width * ratioY);
return ResizeImage(img, newWidth, newHeight);
}
+ public static Image ResizeImageLimit(Image img, int maxPixels)
+ {
+ return ResizeImageLimit(img, maxPixels, maxPixels);
+ }
+
public static Image CropImage(Image img, Rectangle rect)
{
if (img != null && rect.X >= 0 && rect.Y >= 0 && rect.Width > 0 && rect.Height > 0 &&
diff --git a/ShareX.HelpersLib/ShareX.HelpersLib.csproj b/ShareX.HelpersLib/ShareX.HelpersLib.csproj
index d073265ed..164d294c4 100644
--- a/ShareX.HelpersLib/ShareX.HelpersLib.csproj
+++ b/ShareX.HelpersLib/ShareX.HelpersLib.csproj
@@ -37,7 +37,7 @@
true
- none
+ pdbonly
true
bin\Release\
TRACE
@@ -49,6 +49,7 @@
false
true
Off
+ true