Vips.block seems to not work as expected
#410
Replies: 5 comments 10 replies
|
Hi @ClearlyClaire, that's odd, I'll have a look. |
|
I tried a test program: #!/usr/bin/ruby
require "vips"
# block all loaders and savers
Vips.block("VipsForeign", true)
# reenable jpeg load
Vips.block("VipsForeignLoadJpeg", false)
image = Vips::Image.new_from_file(ARGV[0])
puts "image is #{image.width} x #{image.height} pixels"I see: So it seems to work for me (ruby 3.2, ruby-vips 2.2, libvips 8.16). You'll need to find a way to reproduce this error. Is it possible to get more information from the user? |
|
Interesting, I'm getting unreliable results when running that script: Valgrind confirms there's an uninitialized read: (Although I'm not sure how reliable that message is, it's also showing a lot of uninitialized reads within ruby itself. Those are all in the garbage collector, it looks like, so maybe that's to be expected) Not really sure how that happens. FFI confusion over C 'bool' vs. 'gboolean'? Then again, I kind of expect both to expand to an 'int' in terms of ABI. |
|
So that's just bizarre. Let's do ruby-vips 2.2.3 with this fix ASAP. |
|
OK, 2.2.3 with this fix is up. Thank you Kleis! And thanks for the report and feedback @ClearlyClaire and @17dec |
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I'm not sure whether this is a bug, but
Vips.blockdoes not seem to work as intended.Indeed, our codebase uses
Vips.block('VipsForeign', true)thenVips.block('VipsForeignLoadJpeg', false)and others to re-enable a specific list of loaders, but a user reports this is broken on their deployment: mastodon/mastodon#33809 (comment)According to them, they are unable to process JPEG files when
Vips.block('VipsForeignLoadJpeg', false)is called, even when not callingVips.block('VipsForeign', true).I am not sure what is going there here.
All reactions