fschultz / NetImageLibrary

Library to help with image handling such as resizing, cropping, applying filters (brightess, contrast, unsharpen mask, chroma key etc), watermarking, thumbnail creation, opening/saving files or streams and more.
http://kaliko.com/image-library/
Other
90 stars 27 forks source link

BlitFill -- Doesn't fill the whole way #14

Closed Meakeel closed 7 years ago

Meakeel commented 7 years ago

So I'm mostly confused more than anything as to how this has been working in the past

Both the rows and the columns are using the width of the image to see how many rows and columns there should be.

I've changed rows to be Height on my local copy and its working perfectly now.

Kaliko.ImageLibrary.KalikoImage Line 629 onwards

        public void BlitFill(Image image) {
            int width = image.Width;
            int height = image.Height;
            var columns = (int)Math.Ceiling((float)Image.Width/width);
            var rows = (int)Math.Ceiling((float)Image.Width/width);

            for (int y = 0; y < rows; y++) {
                for (int x = 0; x < columns; x++) {
                    _g.DrawImageUnscaled(image, x*width, y*height);
                }
            }
        }
kalikocom commented 7 years ago

Good find! This code can never have worked properly with portrait ratio images and it's amazing that this typo gone unnoticed for so long. Thanks for reporting! Will fix this as soon as possible. A related project using this library to handle images on websites is close to first release, and it's really great to be able to remove this bug as watermarking will be one of the features. Thanks!

fschultz commented 7 years ago

Version 3.0.2 released contain this fix: https://www.nuget.org/packages/ImageLibrary/3.0.2