Skip to content

Vips::Error: vipspng: out of order read at line 352 #109

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

Closed
tomasc opened this issue May 25, 2017 · 21 comments
Closed

Vips::Error: vipspng: out of order read at line 352 #109

tomasc opened this issue May 25, 2017 · 21 comments

Comments

@tomasc
Copy link

tomasc commented May 25, 2017

getting png error on ruby-vips 1.0.5

DragonflyLibvips::Processors::Thumb::format#test_0001_changes the format if passed in:
Vips::Error: vipspng: out of order read at line 352
    /home/travis/.rvm/gems/ruby-2.2.5/gems/ruby-vips-1.0.5/lib/vips/call.rb:186:in `build'
    /home/travis/.rvm/gems/ruby-2.2.5/gems/ruby-vips-1.0.5/lib/vips/call.rb:253:in `invoke'
    /home/travis/.rvm/gems/ruby-2.2.5/gems/ruby-vips-1.0.5/lib/vips/call.rb:282:in `call_base'
    /home/travis/.rvm/gems/ruby-2.2.5/gems/ruby-vips-1.0.5/lib/vips/image.rb:670:in `write_to_buffer'
    /home/travis/build/tomasc/dragonfly_libvips/lib/dragonfly_libvips/processors/thumb.rb:40:in `call'
    /home/travis/build/tomasc/dragonfly_libvips/test/dragonfly_libvips/processors/thumb_test.rb:69:in `block (3 levels) in <top (required)>'

the test output:
https://travis-ci.org/tomasc/dragonfly_libvips

the source code in Ruby:
https://github.com/tomasc/dragonfly_libvips/blob/thumbnail/lib/dragonfly_libvips/processors/thumb.rb#L38-L40

the image:
https://github.com/tomasc/dragonfly_libvips/blob/thumbnail/samples/beach.png

this happens both on my machine (OS X) as well as on Travis CI - both libvips 8.5.5

@jcupitt perhaps I am missing some libs?

@jcupitt
Copy link
Member

jcupitt commented May 26, 2017

Hello, do you know the parameters that thumbnail is being passed when it fails? I'll see if I can make a tiny test case.

@jcupitt jcupitt added the bug label May 26, 2017
@tomasc
Copy link
Author

tomasc commented May 26, 2017

Hi @jcupitt, yes, here they are. All other tests in the gem with the same file are passing …

"samples/beach.png", 2, {"height"=>2, "size"=>#<Vips::Size both>}

and here the full output

VIPS-WARNING **: error in tile 0 x 0
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.1/lib/gobject-introspection/loader.rb:530:in `block in define_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:183:in `build'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:249:in `invoke'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:278:in `call_base'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/image.rb:634:in `write_to_buffer'
	from Devel/dragonfly_libvips/lib/dragonfly_libvips/processors/thumb.rb:41:in `call'
	from Devel/dragonfly_libvips/test/dragonfly_libvips/processors/thumb_test.rb:69:in `block (3 levels) in <top (required)>'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:105:in `block (3 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:202:in `capture_exceptions'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:102:in `block (2 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:253:in `time_it'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:101:in `block in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:349:in `on_signal'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:273:in `with_info_handler'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:100:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:822:in `run_one_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:323:in `run_one_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:310:in `block (2 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:309:in `each'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:309:in `block in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:349:in `on_signal'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:336:in `with_info_handler'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:308:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `block in __run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `map'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `__run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:135:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:62:in `block in autorun'
VIPS-WARNING **: error in tile 0 x 0
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.1/lib/gobject-introspection/loader.rb:530:in `block in define_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:183:in `build'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:249:in `invoke'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:278:in `call_base'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/image.rb:634:in `write_to_buffer'
	from Devel/dragonfly_libvips/lib/dragonfly_libvips/processors/thumb.rb:41:in `call'
	from Devel/dragonfly_libvips/test/dragonfly_libvips/processors/thumb_test.rb:69:in `block (3 levels) in <top (required)>'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:105:in `block (3 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:202:in `capture_exceptions'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:102:in `block (2 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:253:in `time_it'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:101:in `block in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:349:in `on_signal'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:273:in `with_info_handler'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:100:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:822:in `run_one_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:323:in `run_one_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:310:in `block (2 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:309:in `each'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:309:in `block in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:349:in `on_signal'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:336:in `with_info_handler'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:308:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `block in __run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `map'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `__run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:135:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:62:in `block in autorun'
VIPS-WARNING **: error in tile 0 x 0
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.1/lib/gobject-introspection/loader.rb:530:in `block in define_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:183:in `build'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:249:in `invoke'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/call.rb:278:in `call_base'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.4/lib/vips/image.rb:634:in `write_to_buffer'
	from Devel/dragonfly_libvips/lib/dragonfly_libvips/processors/thumb.rb:41:in `call'
	from Devel/dragonfly_libvips/test/dragonfly_libvips/processors/thumb_test.rb:69:in `block (3 levels) in <top (required)>'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:105:in `block (3 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:202:in `capture_exceptions'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:102:in `block (2 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:253:in `time_it'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:101:in `block in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:349:in `on_signal'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:273:in `with_info_handler'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest/test.rb:100:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:822:in `run_one_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:323:in `run_one_method'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:310:in `block (2 levels) in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:309:in `each'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:309:in `block in run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:349:in `on_signal'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:336:in `with_info_handler'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:308:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `block in __run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `map'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:158:in `__run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:135:in `run'
	from .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/minitest-5.10.1/lib/minitest.rb:62:in `block in autorun'

@jcupitt
Copy link
Member

jcupitt commented May 26, 2017

Could you try this command on your machine, please?

$ vips thumbnail path/to/beach.png x.jpg 2 --height 2 --size both

Does the gem always fail, or is it only sometimes?

@tomasc
Copy link
Author

tomasc commented May 26, 2017

the gem always fail

the command line works both to jpg & png:

vips thumbnail samples/beach.png x.jpg 2 --height 2 --size both
vips thumbnail samples/beach.png x.png 2 --height 2 --size both

btw i am thinking of switching back to command line in the gem – may be better to avoid all the Ruby GC madness we were trying to solve in #107

@jcupitt
Copy link
Member

jcupitt commented May 26, 2017

You could try a tiny ruby test program:

require 'vips'

x = Vips::Image.thumbnail "/home/john/pics/beach.png", 2, height: 2, size: "both"
x.write_to_file "x.jpg"

If that works then I guess you need to make a copy of the gem and repeatedly cut tests away until it starts working :(

@tomasc
Copy link
Author

tomasc commented May 29, 2017

@jcupitt so I did try this one – and the thing is it throws up that warning when ran second (and more) time:

require 'test_helper'
require 'vips'

describe 'vips test' do
  let(:thumbnail) { Vips::Image.thumbnail SAMPLES_DIR.join('beach.png').to_s, 2, height: 2, size: Vips::Size::BOTH }

  it 'should work' do
    thumbnail.write_to_file 'result.jpg'
    thumbnail.write_to_file 'result.jpg' # => VIPS-WARNING **: error in tile 0 x 0, Vips::Error: vipspng: out of order read at line 352
  end
end

Do you have any idea why please?

@jcupitt
Copy link
Member

jcupitt commented May 29, 2017

Ah, I understand! Thank you for the very clear example.

Yes, thumbnail does not make a thumbnail, it just builds the first part of an image processing pipeline which will make a thumbnail when you connect it to an output file. When the processing finally happens, it will stream pixels from the source to the destination with no intermediates.

This means you cannot use the result of thumbnail more than once, since after the first time, the source will have run out.

If you get rid of your let it should work:

  it 'should work' do
    thumbnail = Vips::Image.thumbnail SAMPLES_DIR.join('beach.png').to_s, 
        2, height: 2, size: Vips::Size::BOTH
    thumbnail.write_to_file 'result.jpg'

    thumbnail = Vips::Image.thumbnail SAMPLES_DIR.join('beach.png').to_s, 
        2, height: 2, size: Vips::Size::BOTH
    thumbnail.write_to_file 'result.jpg'
  end

Except that unfortunately libvips will try to cache the calls to thumbnail, so it still won't work. There's a NOCACHE flag missing on these operators.

I'll fix it!

jcupitt added a commit to libvips/libvips that referenced this issue May 29, 2017
@jcupitt
Copy link
Member

jcupitt commented May 29, 2017

That might work, would you be able to test?

Thanks again for reporting this!

@tomasc
Copy link
Author

tomasc commented May 29, 2017

hi @jcupitt – just making sure – I need to rebuilt vips from source and test, correct?

@jcupitt
Copy link
Member

jcupitt commented May 29, 2017

That's right, build the head of the 8.5 branch. I can make you a test version of 8.5.6, if that would be easier.

@tomasc
Copy link
Author

tomasc commented May 29, 2017

thanks, that's ok, I should be able to build it from source at git

@tomasc
Copy link
Author

tomasc commented Jun 6, 2017

hi @jcupitt so i built from source. (autogen, make, make install)

vips --version
vips-8.6.0-Tue Jun  6 11:59:09 EDT 2017

still seeing the same issue from:

  it 'should work' do
    thumbnail = Vips::Image.thumbnail SAMPLES_DIR.join('beach.png').to_s, 2, height: 2, size: Vips::Size::BOTH
    thumbnail.write_to_file 'result.jpg'

    thumbnail = Vips::Image.thumbnail SAMPLES_DIR.join('beach.png').to_s, 2, height: 2, size: Vips::Size::BOTH
    thumbnail.write_to_file 'result.jpg'
  end

output:

VIPS-WARNING **: error in tile 0 x 0
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.3/lib/gobject-introspection/loader.rb:575:in `block in define_method'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:185:in `build'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:253:in `invoke'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:282:in `call_base'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/image.rb:632:in `write_to_file'

@jcupitt
Copy link
Member

jcupitt commented Jun 6, 2017

Hi again, thanks for trying this.

I made a tiny test prog:

#!/usr/bin/ruby

require "vips"

thumb = Vips::Image.thumbnail ARGV[0], 2, height: 2, size: "both"
thumb.write_to_file ARGV[1]

thumb = Vips::Image.thumbnail ARGV[0], 2, height: 2, size: "both"
thumb.write_to_file ARGV[2]

It seems to work for me:

$ ./thumb.rb ~/pics/k2.jpg x.jpg y.jpg
$ vipsheader x.jpg y.jpg 
x.jpg: 2x2 uchar, 3 bands, srgb, jpegload
y.jpg: 2x2 uchar, 3 bands, srgb, jpegload

Could you try on your machine?

If you are using ruby-vips via bundle, I think you will need to update the bundle after rebuilding the library.

@tomasc
Copy link
Author

tomasc commented Jun 6, 2017

@jcupitt yup same old.
I tried both with PNG & JPG.

ruby vips_test.rb samples/beach.png 1.png 2.png

VIPS-WARNING **: error in tile 0 x 0
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.6/lib/gobject-introspection/loader.rb:575:in `block in define_method'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:185:in `build'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:253:in `invoke'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:282:in `call_base'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/image.rb:632:in `write_to_file'
	from vips_test.rb:9:in `<main>'
VIPS-WARNING **: error in tile 0 x 0
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.6/lib/gobject-introspection/loader.rb:575:in `block in define_method'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:185:in `build'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:253:in `invoke'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:282:in `call_base'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/image.rb:632:in `write_to_file'
	from vips_test.rb:9:in `<main>'
VIPS-WARNING **: error in tile 0 x 0
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.6/lib/gobject-introspection/loader.rb:575:in `block in define_method'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:185:in `build'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:253:in `invoke'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:282:in `call_base'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/image.rb:632:in `write_to_file'
	from vips_test.rb:9:in `<main>'
…/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:186:in `build': vipspng: out of order read at line 352 (Vips::Error)
vips2png: unable to write "bar.png"
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:253:in `invoke'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/call.rb:282:in `call_base'
	from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips/image.rb:632:in `write_to_file'
	from vips_test.rb:9:in `<main>'

@jcupitt
Copy link
Member

jcupitt commented Jun 6, 2017

Sorry, I think you must be picking up an old version. Maybe wipe your installed vips libs? Or reinstall the gem?

@tomasc
Copy link
Author

tomasc commented Jun 7, 2017

Hi @jcupitt , I have:

  • uninstalled old vips (brew uninstall libvips)
  • removed both ruby-vips and gobject-introspection
  • pulled down libvips from master branch
  • compiled (./autogen.sh, make, make install)
  • reinstall gems

Vips is at:

vips --version
vips-8.6.0-Wed Jun  7 10:03:14 EDT 2017

And now i am getting:

…/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.6/lib/gobject-introspection/loader.rb:37:in `require': Typelib file for namespace 'Vips' (any version) not found (GObjectIntrospection::RepositoryError::TypelibNotFound)
from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/gobject-introspection-3.1.6/lib/gobject-introspection/loader.rb:37:in `load'
from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips.rb:79:in `init'
from …/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ruby-vips-1.0.5/lib/vips.rb:47:in `const_missing'
from vips_test.rb:5:in `<main>'

Any suggestions please?

@jcupitt
Copy link
Member

jcupitt commented Jun 7, 2017

Hi, sounds like the typelib is missing.

Do you have /usr/local/lib/girepository-1.0/Vips-8.0.typelib? If not, check the output of autogen.sh and make sure you have "yes" for the goi machinery:

gobject introspection: 			yes
install vips8 Python overrides:		yes
  (requires pygobject-3.13.0 or later)

If you do have that file, you probably need to set GI_TYPELIB_PATH to /usr/local/lib/girepository-1.0.

@jcupitt
Copy link
Member

jcupitt commented Jun 8, 2017

I've not been able to update the vips on homebrew, it's been blocked on a separate issue.

That's now resolved, so I'll do an 8.5.6 that includes this fix. That should get you going again.

@tomasc
Copy link
Author

tomasc commented Jun 8, 2017

Thanks a lot John, much appreciated. I will test and close this issue if all ok.

@tomasc
Copy link
Author

tomasc commented Jun 9, 2017

Hi @jcupitt , indeed 8.5.6 solves that issue.
Closing this.

@tomasc tomasc closed this as completed Jun 9, 2017
@jcupitt
Copy link
Member

jcupitt commented Jun 9, 2017

Thanks for testing!

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