Skip to content

FillRegionProcessor.OnFrameApply IndexOutOfRangeException when calling DrawLines with specific parameters #928

@woutware

Description

@woutware

Description

Bug

Steps to Reproduce

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using SixLabors.Fonts;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Drawing;
using SixLabors.ImageSharp.Processing.Overlays;
using SixLabors.ImageSharp.Processing.Text;
using SixLabors.Primitives;
using SixLabors.Shapes;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            DrawLinesBug(@"D:\support\ImageSharp\DrawLinesBug.png", new RectangleF(0, 0, 2000, 2000));
            
            Console.WriteLine("Hello World!");
            Console.ReadLine();
        }

        public static void DrawLinesBug(string savePath, RectangleF rectText) {
            using (Image<Rgba32> img = new Image<Rgba32>((int)rectText.Width, (int)rectText.Height)) {
                img.Mutate(x => x.Fill(Rgba32.Transparent));

                img.Mutate(ctx => {
                    ctx.DrawLines(
                        Rgba32.Red,
                        0.984252f,
                        new PointF(104.762581f, 1074.99365f),
                        new PointF(104.758667f, 1075.01721f),
                        new PointF(104.757675f, 1075.04114f),
                        new PointF(104.759628f, 1075.065f),
                        new PointF(104.764488f, 1075.08838f),
                        new PointF(104.772186f, 1075.111f),
                        new PointF(104.782608f, 1075.13245f),
                        new PointF(104.782608f, 1075.13245f)
                        );
                    }
                );

                SixLabors.ImageSharp.Formats.Png.PngEncoder pngEncoder = new SixLabors.ImageSharp.Formats.Png.PngEncoder();
                pngEncoder.CompressionLevel = 0;

                FileStream fileStream = new FileStream(savePath, FileMode.OpenOrCreate);
                img.SaveAsPng(fileStream, pngEncoder);
            }
        }
    }
}

System Configuration

Win 10, .NET Core 2.0

  • ImageSharp version: 1.0.0-beta0006
  • Other ImageSharp packages and versions:
  • Environment (Operating system, version and so on):
  • .NET Framework version:
  • Additional information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions