-
Notifications
You must be signed in to change notification settings - Fork 10
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
Q: How to access get_disc_threshold() and other global functions? #17
Comments
Hi @LeslieGerman, no, sorry, that function is not wrapped by lua-vips. You would need to write a little FFI code and call it yourself. What are you trying to achieve? Perhaps there is some other way to do what you want. |
Well, first just experimenting... I want to achieve something like the abandoned vips streaming branch would do, but with manual-coding on top of the existing vips API. Basically our framework would call the following filter function, passing bytes-sequences of a JPEG, GIF etc. image in chunks:
The filter would return the bytes of the transformed image in chunks, too. Is it possible to implement this on top of the current API? (vips is a great lib, BTW :) ) |
Just a note: |
Ah OK. No, sorry, I don't think that can be done. You have to read the whole of the compressed image into memory. The true-streams idea should probably be resurrected :( It's not actually a huge amount of work, you only need to add support to the streamable formats, it's just a question of someone finding the time. |
Hi John, It seems to me the task consists of 2 steps:
Regarding 1: Regarding 2: And the important question for me: Thanks. |
libvips is a "pull" system, so you can't push bytes into it as they arrive, instead you'd need to attach a callback to libvips to grab another chunk of input when it's needed. The streaming branch added a couple of simple classes which you could put the callbacks into. The API would look something like:
now libvips will call the There's something similar to for output streams. Anyway, I'd guess a couple of weeks work. |
Hi John,
I wanted to use the get_disc_threshold() function.
But vips.get_disc_threshold () does not exist.
How can I use it and other global functions?
They seem like not "exposed" to Lua.
Or do I misunderstand something?
Thanks.
The text was updated successfully, but these errors were encountered: