dansiegel / Mobile.BuildTools

The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
http://mobilebuildtools.com
MIT License
228 stars 29 forks source link

Horizontal Watermark banner is chopped off #207

Closed bijington closed 3 years ago

bijington commented 3 years ago

Description

When choosing WatermarkPosition.Top or WatermarkPosition.Bottom the banner has half chopped off.

Reproduction Steps

Half the banner and text is chopped as it is outside of the bounds of the image.

Expected Behavior

The banner and text should render.

Actual Behavior

Half the banner and text is chopped as it is outside of the bounds of the image.

Environment

Reproduction App

Based on unit test ImageResizerGeneratorFixture.AppliesTextBanner:

var config = GetConfiguration();
config.IntermediateOutputPath += GetOutputDirectorySuffix((nameof(text), text), (nameof(scale), scale));
var generator = new ImageResizeGenerator(config);

var image = new OutputImage
{
    Height = 0,
    Width = 0,
    InputFile = Path.Combine(TestConstants.ImageDirectory, "dotnetbot.png"),
    OutputFile = Path.Combine(config.IntermediateOutputPath, "dotnetbot.png"),
    OutputLink = Path.Combine("Resources", "drawable-xxxhdpi", "dotnetbot.png"),
    RequiresBackgroundColor = true,
    Scale = scale,
    ShouldBeVisible = true,
    Watermark = new WatermarkConfiguration
    {
        Text = text,
        Position = WatermarkPosition.Top
    }
};

generator.ProcessImage(image);
bijington commented 3 years ago

Fixed in PR #208