- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 888
Closed
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp.Drawing
-  I have verified if the problem exist in both DEBUGandRELEASEmode
- I have searched open and closed issues to ensure it has not already been reported
Description
When using the DrawImage method to draw an image outside of the original image's bounds (i.e., where the two images do not overlap), an ImageProcessingException is thrown, with message Cannot draw image because the source image does not overlap the target image.. I would have expected the method to silently do nothing, instead.
Steps to Reproduce
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
Image smallerImage = Image.Load(@"C:\Users\Giorgio\Downloads\test50x50.jpg"); // A 50x50 pixel image
Image image = new Image<SixLabors.ImageSharp.PixelFormats.Rgba32>(100, 100); // A new 100x100 image on which to draw.
// These work:
image.Mutate(x => x.DrawImage(smallerImage, new Point(10, 10), new GraphicsOptions()));
image.Mutate(x => x.DrawImage(smallerImage, new Point(-20, -20), new GraphicsOptions()));
image.Mutate(x => x.DrawImage(smallerImage, new Point(80, 80), new GraphicsOptions()));
// These throw the exception:
image.Mutate(x => x.DrawImage(smallerImage, new Point(110, 110), new GraphicsOptions()));
image.Mutate(x => x.DrawImage(smallerImage, new Point(-60, -60), new GraphicsOptions()));System Configuration
- ImageSharp.Drawing version: tried with 1.0.0-beta14 and 1.0.0-beta14.10
- Other ImageSharp packages and versions: tried with ImageSharp 2.0.0 and 3.0.0-alpha.0.11
- Environment (Operating system, version and so on): Windows 10
- .NET Framework version: .NET 6
- Additional information: N/A