net-vips: Image.Thumbnail causes distortion on underlying file

I’ve been using NetVips successfully for many images, but a few have suddenly caused some weird distortions and I cannot understand why.

This is the original file test expected

This is the thumbnail produced: test2_output

Here is the code

var expectedBytes = Image.Thumbnail("expected.jpg"), 320).WriteToBuffer(".png");
var thumbnail = Image.Thumbnail("input.jpg", 320);
thumbnail.WriteToFile("ouput/expected.png");
var actualBytes = File.ReadBytes("output/expected.png")

Assert.Equal(expectedBytes, actualBytes)

I tried both jpg and png (not sure if NetVips does anything different), but it always spits out this weird corrupted version. Yet windows viewer can open it fine.

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

NetVips.Native v8.12.2 is now available with this fix included. Thanks for reporting this!

I don’t think we’ve found the right fix yet, unfortunately 😦 I’m poking about now.