Skip to content
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

Progress events #10

Open
aseemk opened this issue Feb 21, 2015 · 5 comments
Open

Progress events #10

aseemk opened this issue Feb 21, 2015 · 5 comments

Comments

@aseemk
Copy link
Member

aseemk commented Feb 21, 2015

It'd be nice if this lib could emit progress events during conversion. That'd be helpful to e.g. show a progress bar on ZoomHub. (As well as e.g. for user feedback in a CLI.)

Adding this to the IM implementation should be easy, but VIPS is harder, as it abstracts the whole thing away and doesn't emit progress events either AFAIK.

One idea @gasi and I discussed was to watch the output level directories for generated tiles. Don't know how feasible that is though, e.g. across platforms, Node versions, performance, etc.

If that proves to be a non-starter, another approach is to just fudge it with a timer. E.g. every second, see how many tiles have been generated, and emit the event then.

This isn't high-priority; just capturing these ideas.

@jcupitt
Copy link

jcupitt commented Jan 18, 2016

libvips supports progress feedback in a couple of ways. You can call vips_image_set_progress() on an image and you'll be sent gobject signals as that image is processed:

http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/libvips-VipsImage.html#vips-image-set-progress

So just before calling vips_dzsave() you ask for progress signalling on the image you pass in and attach signal handlers for preeval, eval and posteval.

You can also get progress signalling on the CLI. Set VIPS_PROGRESS or use the --vips-progress flag and the vips driver program will draw ASCII bar graphs of evaluation progress. It's a bit fragile, but you could parse that.

@iangilman
Copy link
Member

@jcupitt Awesome, good to know!

@gasi
Copy link
Member

gasi commented Jan 19, 2016

@jcupitt Thanks for dropping by and letting us know. I actually made a note to myself about a month ago when I looked into it and saved the following snippet as parsing test sample:

> vips dzsave hs-2007-16-a-full_tif.tif carina-nebula --vips-progress
vips temp-1: 29566 x 14321 pixels, 8 threads, 128 x 128 tiles, 256 lines in buffer
vips temp-1: 100% complete> vips dzsave hs-2007-16-a-full_tif.tif carina-nebula --vips-progress
vips temp-1: 29566 x 14321 pixels, 8 threads, 128 x 128 tiles, 256 lines in buffer
vips temp-1: done in 71.4s    

P.S. How did you find this issue? 👀 😉

@jcupitt
Copy link

jcupitt commented Jan 19, 2016

Hehe, github linked this issue from something on ruby-vips, I think. I'm trying to fix that up at the moment.

Yes, I noticed the signal links were broken yesterday :-( stupid gtk-doc, another thing for the TODO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants