Skip to content

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

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:

Activity

  1. JimBobSquarePants commented on Jun 7, 2019

    @JimBobSquarePants
    Member

    Hi @woutware Thanks for supplying all the info.

    Is the issue still present in the latest development builds from MyGet?

  2. woutware commented on Jun 7, 2019

    @woutware
    ContributorAuthor

    My git skills are rusty, I did a Pull in GitHub desktop on the ImageSharp repository, that should get me the latest sources isn't it?

  3. woutware commented on Jun 7, 2019

    @woutware
    ContributorAuthor

    Still using https://github.com/woutware/ImageSharp.git that I used last year to build locally.

  4. woutware commented on Jun 7, 2019

    @woutware
    ContributorAuthor

    Oh shit that's my own fork. How do I synch it again?

  5. woutware commented on Jun 7, 2019

    @woutware
    ContributorAuthor

    Ok, it was git pull upstream master. My local build is totally broken though with all the changes, I'll need to look at it closer in the weekend, but my guess is the bug is still there, it's pretty circumstantial.

  6. 101100 commented on Aug 11, 2019

    @101100
    Contributor

    @woutware This was fixed in #964. I was able to test it in my project using the nightly build 1.0.0-dev002846 on MyGet.

  7. added a commit that references this issue on Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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