-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String corruption with VipsForeignLoad / VipsForeignSave when using in Unity #131
Comments
It doesn't work properly on some versions of Mono.
IIRC, I had similar issues with older versions of Mono in combination with Given that information, and that Unity 2021.2 is still an alpha version, I think it makes more sense to avoid using <packageSources>
<add key="netvips-nightly" value="https://ci.appveyor.com/nuget/net-vips" />
</packageSources> And update NetVips to 2.0.0 (build number 276 - prerelease). If that works, I'll try to integrate that in NetVips 2.0.1. |
Oh curious, let me try to reproduce it on my Windows PC. Do you have a test branch somewhere that I can The screenshots and changes (i.e. |
ok. sorry in advance for instructions that are a little long.
They should show up flagged with "local" in a box:
You can download that here (it's 19mb) If all that worked, you should see the error in the console: |
Thanks for these instructions, I could reproduce it on Windows. It seems that the Mono version provided by Unity doesn't properly null-terminate strings(?), I was able to fix/workaround this with commit 95a9627 (which should be available as nightly version 2.0.0 build number 277). I'll investigate further why this only occurs on Mono and not on .NET Core/Framework, in the meantime you might also be interested in these changes: |
@kleisauke your reactivity and efficiency never ceases to amaze me :) @jsm174 lemme know if I should merge that branch! Thanks to both of you! |
@kleisauke - awesome. Thank you again! @freezy - sure we can merge the branch listed above! |
It doesn't work properly on some versions of Mono.
Thanks for the kind words. After further investigation, it looks like I assumed that passing a byte array via P/Invoke will always add a null-terminator, which turned out to be incorrect, although it did work in most cases. I've merged the above mentioned commits to the master branch, expect a new release soon. |
NetVips v2.0.1 is now available. Thanks for reporting this! |
When trying to use NetVips in Unity (2020.3.12f1), we are seeing string corruption issues with methods that call
VipsForeignLoad
/VipsForeignSave
:For example:
errors with:
and
errors with:
We are seeing this on MacOS and Windows. (Did not try on Linux yet)
The text was updated successfully, but these errors were encountered: