Replies: 10 comments
-
Hello @tomasc, it should just work, ruby-vips is supposed to self-update. I see: Perhaps your ruby is picking up a libvips that's been built without |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@jcupitt indeed |
BetaWas this translation helpful?Give feedback.
-
Try to hint the file type: x.write_to_buffer".gif",format: "gif" |
BetaWas this translation helpful?Give feedback.
-
Yes, I guess |
BetaWas this translation helpful?Give feedback.
-
@kleisauke@jcupitt yes that works! But only when saving to gif. x=Vips::Image.new_from_file"sample.gif"x.write_to_buffer(".jpg",format: "jpg")Vips::Error: unabletocallVipsForeignSaveJpegBuffer: unknownoptionformat |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In other words, it feels funny to hint the format only on certain formats (gif) – should not this work across the board? |
BetaWas this translation helpful?Give feedback.
-
It does seem weird. It's to do with the way that savers work in libvips. libvips has a saver operation for each file format, so there's im.jpegsave"somefilename",Q: 85There are versions with str=im.jpegsave_bufferQ: 85When a saver class is initialized, it registers a list of suffixes it supports with libvips, eg. im.write_to_file"somefile.jpg"libvips extracts the suffix from the filename, then walks the saver list, searching for the highest priority saver which has registered that suffix. It then invokes that operation on your filename, passing down any options. For buffer output, it passes down the options, but does not pass down the filename (why would you need a filename for buffer output?). This causes problems for I suppose the fix would be for |
BetaWas this translation helpful?Give feedback.
-
Thanks, John. I worked around that for the time being in dargonfly_libvips. To me, it would be make sense if |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Heh, I see I'm not the one who was confused by that there is some magic format guessing based on the extension. |
BetaWas this translation helpful?Give feedback.
-
For anyone looking for how to preserve a gif's animation when generating variants with vips and ActiveStorage: post.image.variant(loader: {n: -1},resize_to_limit: [400,400])with |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems is possible to output
.giffiles in libvips~> 8.7.0via command-line, but not usingruby-vips. Is that correct? Do we need to updateruby-vipssomehow? If so, I can try to start a PR if you could point me to the right direction …BetaWas this translation helpful?Give feedback.
All reactions