Skip to content

LightResize and ImageResizer produce different output with FitMode.Crop #20

Description

@stakx

Given this test.jpg:

test

And the following code (which references NuGet packages ImageResizer and LightResize):

ImageResizer.ImageBuilder.Current.Build("test.jpg", "test-resized-imageresizer.jpg",
    new ImageResizer.Instructions
    {
        Scale = ImageResizer.ScaleMode.Both,
        Mode = ImageResizer.FitMode.Crop,
        Width = 240,
        Height = 200,
    });

LightResize.ImageBuilder.Build("test.jpg", "test-resized-lightresize.jpg",
    new LightResize.Instructions
    {
        Scale = LightResize.ScaleMode.Both,
        Mode = LightResize.FitMode.Crop,
        Width = 240,
        Height = 200,
    });

The two resized images appear to be stretched differently in the vertical direction:

test-resized-imageresizer.jpg test-resized-lightresize.jpg

This appears to happen only when the image will be cropped vertically.

Investigate what is the cause of this difference (coordinate rounding?), and whether it qualifies as a (minor) bug in LightResize.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions