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.WriteToFile crashes with NetVips.Native 8.9.0-rc4

See original GitHub issue

Image.WriteToFile method with NetVips.Native 8.9.0-rc4 sometimes crashes unpredictably. I have an application, that writes tiles by cropping GeoTIFF. I’ve run some tests on CI and local machine (Win10). Each test writes approximately 7000 tiles. I’ve got following results: 8 tests on linux (CI) - passes without errors 12 tests on windows (CI) - 1/12 crashed 20 tests on windows (local) - 5/12 crashed

At first I tried to downgrade to NetVips 1.1.0 instead of 1.2.0-rc2 but that didn’t solve the issue. Then I tried to downgrade to NetVips.Native 8.8.4 and run through unit tests again: 20 tests on windows (local) - all passes

I also looked into tiles, that was written wrong and their correct versions, they look like this:

Broken: 27304

Correct: 27304_2

The exact fragment of code, throwing the exception is following:

outputImage = NetVips.Image.Black(Enums.Image.Image.TileSize, Enums.Image.Image.TileSize).NewFromImage(0, 0, 0, 0);

// Insert tile into output image
outputImage = outputImage.Insert(tileImage, writePosX, writePosY);

//This string throws an exception sometimes
outputImage.WriteToFile(outputTileFileInfo.FullName);

Vips’s exception message:

unable to call VipsForeignSavePngFile
    TIFFFillTile: Seek error at row 3584, col 0, tile 194
    vips2png: unable to write to target

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
kleisaukecommented, Jan 30, 2020

Ah I see, Python does indeed have (pretty) good memory behavior. Let me know if I should open a separate issue on the ruby-vips repo (the reference count might increase if running that loop parallelized, but I didn’t test that).

@Gigas002 NetVips v1.2.0 and NetVips.Native v8.9.1 is now available. Thanks for reporting this!

1reaction
jcupittcommented, Jan 14, 2020

That seems to fix it for me.

Thanks for reporting this @Gigas002 !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image.WriteToFile crashes with NetVips.Native 8.9.0-rc4
Image.WriteToFile method with NetVips.Native 8.9.0-rc4 sometimes crashes unpredictably. I have an application, that writes tiles by cropping ...
Read more >
Getting Started with NetVips
WriteToFile writes an image back to the filesystem. It can write any format supported by vips: the file type is set from 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