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

This is the thumbnail produced:

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
- Keep header bytes during pixel decode phase See: https://github.com/kleisauke/net-vips/issues/155. — committed to kleisauke/libvips by kleisauke 2 years ago
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.