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

dzsave support #54

Closed
piktur opened this issue Apr 11, 2014 · 3 comments
Closed

dzsave support #54

piktur opened this issue Apr 11, 2014 · 3 comments

Comments

@piktur
Copy link

piktur commented Apr 11, 2014

I understand libvips8 will automate integration of new and updated features, however advice on implementation or, better still, an example for dzsave within a rails app (using CarrierWave) would be greatly appreciated.

Or if not, flag it for addition to the CarrierWave-Vips gem.

@jcupitt
Copy link
Member

jcupitt commented Apr 12, 2014

ruby-vips is based on vips7. dzsave is part of vips8 and so you can't
use it from ruby-vips. vips8 is almost done (about 90% of the way
though, it's taken 6 years, ouch) and there will be a ruby-vips8 based
on it, but it might be another year or maybe longer.

I don't know what the best solution to your problem would be. Does
carrierwave have any support for generating things like deepzoom
pyramids as part of the upload process? If there's a framework there
that you can just hook into, then it might be worth adding something
to shell out to vips. Essentially you just need to add one line
somewhere:

  system "vips dzsave #{filename_of_full_res_image} #{name_of_desired_deepzoom_image} #{dzsave_options}"

But I don't know carrierwave well enough to know where to add this, or
even if there's a good place to paste it in. You could ask the
carrierwave people.

dzsave takes about 2 - 3s for a 10,000 x 10,000 pixel RGB image, so it
should be fine to run it like this.

A simpler solution would be to run that command yourself as part of
your ruby program. Hook something in to execute at the end of every
upload and generate the deepzoom pyramid there. It wouldn't work well
for very large images (many 100s of megabytes) or very high image
volume (more than one image uploaded every 10s), but it would be fine
for a fairly modest site.

@jcupitt
Copy link
Member

jcupitt commented Jan 18, 2016

There's an experimental ruby-vips8 binding with dzsave support here:

https://github.com/jcupitt/ruby-vips8

It has the serious problem that it must force a GC before each call to libvips :-( so still not quite production-ready.

@jcupitt
Copy link
Member

jcupitt commented Jun 7, 2016

ruby-vips has now been bumped to 1.0 and an API break. The new API supports dzsave, so you should be all set.

@jcupitt jcupitt closed this as completed Jun 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants