Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.6.0" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.17.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using ImageMagick;
using ImageMagick.Drawing;

namespace ImageMagickLibrary;

public static class ImageService
{
public static MagickImage CreateBlankImage(int width, int height, MagickColor color)
public static MagickImage CreateBlankImage(uint width, uint height, MagickColor color)
{
return new MagickImage(color, width, height);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var image = ImageService.CreateBlankImage(480, 300, MagickColors.AliceBlue);
var strokeColor = MagickColors.YellowGreen;
var fillColor = MagickColors.Transparent;
var circle = ImageService.CreateCircle(image.Width / 2, image.Height / 2, 100, 5, strokeColor, fillColor);
var circle = ImageService.CreateCircle((int)image.Width / 2, (int)image.Height / 2, 100, 5, strokeColor, fillColor);
ImageService.DrawOnImage(image, circle);
ImageService.SaveImage(image, outputPath);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class ImageMagickLibraryLiveTest
public ImageMagickLibraryLiveTest()
{
_expectedColor = _color;
_centerX = _circle.X + _circle.Width / 2;
_centerY = _circle.Y + _circle.Height / 2;
_radius = _circle.Width / 2;
_centerX = _circle.X + (int)_circle.Width / 2;
_centerY = _circle.Y + (int)_circle.Height / 2;
_radius = (int)_circle.Width / 2;
_strokeWidth = 5;
}

Expand Down Expand Up @@ -51,9 +51,9 @@ public void GivenValidSize_WhenCreateBlankImage_ThenReturnMagickImage()
}

[Theory]
[InlineData(0, 200)]
[InlineData(400, 0)]
public void GivenInvalidSize_WhenCreateBlankImage_ThenThrowArgumentException(int width, int height)
[InlineData(0u, 200u)]
[InlineData(400u, 0u)]
public void GivenInvalidSize_WhenCreateBlankImage_ThenThrowArgumentException(uint width, uint height)
{
// Arrange, Act & Assert
Assert.Throws<ArgumentException>(() => ImageService.CreateBlankImage(width, height, MagickColors.White));
Expand Down
Loading