question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image.Thumbnail causes distortion on underlying file

See original GitHub issue

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?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kleisaukecommented, Jan 27, 2022

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

1reaction
jcupittcommented, Jan 22, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Distorted Thumbnail for .docx file - photools.com
The thumbnail images do indeed show in IMatch, but the newer format (.docx) file is curiously distorted, as shown in the attached screenshot ......
Read more >
Distorted Thumbnails after exporting from Photoshop
I have been heavily editing images in photoshop (mainly sharpening them up) and I am having a problem with image thumbnails after exporting ......
Read more >
Image resizing is exporting distorted - Bug
It appears you have a filter applied to the Master track. Click on the actual image clip and apply Size & Position filter...
Read more >
IMAGE RESIZE WITHOUT DISTORTION - The Easy Way
Enlargement reduces picture quality, causing the modified image to seem fragmented or hazy. Suppose the picture aspect ratio is modified to fit.
Read more >
How to scale up image into thumbnail without distorting it?
When using a smaller image as featured image (smaller than the thumbnail size, in width or height) it gets distorted to fill the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found