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

Use :scale on images embedded in text. #160

Open
ryanabrams opened this Issue Jun 5, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@ryanabrams

ryanabrams commented Jun 5, 2016

When I try to use :scale for the height attribute of images embedded into text, I get a fatal error, reporduced below. This used to work (in like 0.6 iirc - I jumped a lot of versions recently).

/Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:56:in `>': comparison of Symbol with 0 failed (ArgumentError)
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:56:in `block in max_embed_height'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:55:in `each'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:55:in `inject'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:55:in `max_embed_height'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:151:in `block in text'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/card.rb:50:in `yield'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/card.rb:50:in `use_cairo'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/graphics/text.rb:124:in `text'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/api/text.rb:20:in `block in text'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/args/card_range.rb:13:in `call'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/args/card_range.rb:13:in `block in each'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/args/card_range.rb:13:in `each'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/args/card_range.rb:13:in `each'
    from /Users/ryan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/squib-0.10.0/lib/squib/api/text.rb:20:in `text'

@andymeneely andymeneely added the bug label Jun 8, 2016

@andymeneely

This comment has been minimized.

Show comment
Hide comment
@andymeneely

andymeneely Jun 8, 2016

Owner

Actually I think the :scale option is pretty new, so it may have never worked. I'll take a look.

Owner

andymeneely commented Jun 8, 2016

Actually I think the :scale option is pretty new, so it may have never worked. I'll take a look.

andymeneely added a commit that referenced this issue Sep 8, 2016

@andymeneely

This comment has been minimized.

Show comment
Hide comment
@andymeneely

andymeneely Sep 15, 2016

Owner

This might happen someday, but not on this release. It's a handy method to have, but it gets squirrely with embedded icons. For now, I'm just documenting the lack of behavior and considering it a future feature.

Owner

andymeneely commented Sep 15, 2016

This might happen someday, but not on this release. It's a handy method to have, but it gets squirrely with embedded icons. For now, I'm just documenting the lack of behavior and considering it a future feature.

@andymeneely andymeneely added enhancement and removed bug labels Sep 15, 2016

@andymeneely andymeneely changed the title from Can't use :scale on images embedded in text. to Use :scale on images embedded in text. Sep 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment