Giter VIP home page Giter VIP logo

dragonfly_libvips's People

Contributors

anitagraham avatar asgerb avatar bartuz avatar narkoz avatar tomasc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dragonfly_libvips's Issues

encode_test fails with Vips::Error: unable to call VipsForeignSaveJp2kBuffer: unknown option profile

I am running the test suite (in preparation for submitting a PR) and getting this failure, which is not, I think, related to the PR. Here is the stack trace:

  test_0118_svg to jpc                                           ERROR (0.00s)
Minitest::UnexpectedError:         Vips::Error: unable to call VipsForeignSaveJp2kBuffer: unknown option profile
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/ruby-vips-2.1.2/lib/vips/operation.rb:379:in `block in call'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/ruby-vips-2.1.2/lib/vips/operation.rb:374:in `each'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/ruby-vips-2.1.2/lib/vips/operation.rb:374:in `call'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/ruby-vips-2.1.2/lib/vips/image.rb:629:in `write_to_buffer'
            /private/var/www/dragonfly_libvips/lib/dragonfly_libvips/processors/encode.rb:44:in `call'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job/process.rb:23:in `apply'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:119:in `block in apply'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:119:in `each'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:119:in `apply'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:250:in `result'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/2.7.0/forwardable.rb:229:in `mime_type'
            /private/var/www/dragonfly_libvips/test/dragonfly_libvips/processors/encode_test.rb:20:in `block (5 levels) in <top (required)>'

I am running

  • vips-8.11.3-Wed Aug 11 09:29:27 UTC 2021
  • dragonfly_libvips 2.4.2
  • Ruby 2.7.2, 3.02
  • macOS 11.6

The doc for jp2ksave doesn't include :profile in the options list.
(Checked pngsave - does include :profile)

If it is as simple as adding jp2k to list of options without profile support I can submit a PR for that.
Is there anywhere else to look?

thanks,

Anita

Ruby 3.0+ compatibility issue (ArgumentError exception)

Hello

While using

  • dragonfly_libvips (2.4.2)
  • ruby-vips (2.1.4)
  • ruby (3.1.0)

(notice: those versions are the newest releases of libraries) there is an argument error wrong number of arguments (given 2, expected 1)

while calling stack trace:

ruby-vips (2.1.4) lib/vips/image.rb:273:in `new_from_file'
dragonfly_libvips (2.4.2) lib/dragonfly_libvips/analysers/image_properties.rb:17:in `call'

links to source code to your convenience:
https://github.com/libvips/ruby-vips/blob/master/lib/vips/image.rb#L273
and dragonfly https://github.com/tomasc/dragonfly_libvips/blob/master/lib/dragonfly_libvips/analysers/image_properties.rb#L17

We can extract this logic to a simple example to run in any Ruby 3.1.0 REPL:

def new_from_file name, **opts
  puts("name: #{name}, opts: #{opts}")
  puts("it worked!")
end

opts = { a: 'a', b: 'b' }

#good

new_from_file "good", **opts

# bad

new_from_file "bad", opts

which executes to:


name: good, opts: {:a=>"a", :b=>"b"}
it worked!
ArgumentError: wrong number of arguments (given 2, expected 1)
from (pry):1:in `new_from_file'

Tests raise error VipsForeignSave: ".raw" is not a known buffer format

Running the test suite I get this error (x6)

 test_0080_pdf to raw                                           ERROR (0.00s)
Minitest::UnexpectedError:         Vips::Error: VipsRegion: valid clipped to nothing
        VipsForeignSave: ".raw" is not a known buffer format
        
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/ruby-vips-2.1.2/lib/vips/image.rb:627:in `write_to_buffer'
            /private/var/www/dragonfly_libvips/lib/dragonfly_libvips/processors/encode.rb:44:in `call'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job/process.rb:23:in `apply'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:119:in `block in apply'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:119:in `each'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:119:in `apply'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/dragonfly-1.4.0/lib/dragonfly/job.rb:250:in `result'
            /Users/anita/.rbenv/versions/2.7.2/lib/ruby/2.7.0/forwardable.rb:229:in `mime_type'
            /private/var/www/dragonfly_libvips/test/dragonfly_libvips/processors/encode_test.rb:20:in `block (5 levels) in <top (required)>'

I can't see what/why it is happening.
In some instances the error "valid clipped to nothing" is repeated many times - perhaps that is the real problem.

Suggestion: generate progressive JPEGs

Hi @tomasc,

Looking into performance/speed/compression it seems that progressive JPEGs are preferred (here, here or here).

Currently the thumbnail processor does not generate progressive JPEGs and I'm wondering if this might not be a useful addition? Could also be a new processor, but since it's only for JPEGs I'm not sure how to implement that.

It unfortunately seems that vips' .thumbnail method does not support "interlacing" (progressive), but it can be done with the .jpegsave method: https://github.com/jcupitt/ruby-vips/blob/428d5c106fb4a64521159c6b0c4f9391eea2eba6/lib/vips/methods.rb#L1333

Let me know your thoughts and I can try and take a stab at this ๐Ÿ™‚

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.