Closed ImagicTheCat closed 4 years ago
Should the same thing be done for write_to_memory
since the ffi.sizeof
would not give a meaningful size anymore ?
Yes, the test fails will need fixing.
I think about write_to_memory_nocopy
as a suitable name for the alternative of write_to_memory
.
I don't think there's an API change in write_to_memory
, is there? I think the name can stay, unless I've misunderstood.
I thought since it doesn't return an FFI data anymore the behavior to get the size changed. But most uses will probably be about accessing the pointer and process the data using the image width, height, bands and format.
Ooop, of course you are right, sorry. I've not looked at this for a while.
Sure, _nocopy
sounds like a reasonable name.
No problem, I will do that and try to write the corresponding tests.
I used malloc for the unit test (and made the mistake of being lazy to test it locally) for clarity (compared to a simple cast). It should be fine now.
This looks like a nice improvement, thank you for working on this, @ImagicTheCat!
I'll add a note to the CHANGELOG, bump the version and update the rock.
Oh, I wanted to rebase into a single commit after your approval, so the commits were very simple, I suppose they will do.
Thank you for maintaining libvips, it is very useful. I may try to improve the OpenEXR support one day.
Yes, it's a simple change, I think it's OK.
Yes, the EXR loader is pretty bad :( It's needs modernising.
Hi, I was using lua-vips for processing and I encountered this limitation. FFI is low level, so it makes sense to not abstract away the pointer/size.
(I edited example/array.lua by mistake, fixed it, but the pull request is not updated)