Skip to content
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

image_optim sprockets preprocessor fails at .webp image #124

Open
thehappycoder opened this issue Jan 27, 2016 · 3 comments
Open

image_optim sprockets preprocessor fails at .webp image #124

thehappycoder opened this issue Jan 27, 2016 · 3 comments

Comments

@thehappycoder
Copy link

$ RAILS_ENV=production rake assets:precompile
svgo worker: `svgo` not found; please provide proper binary or disable this worker (--no-svgo argument or `:svgo => false` through options)
rake aborted!
Sprockets::EncodingError: /Users/anton/pwork/utro/app/assets/images/sprites/1x/build/extra/extra-no-repeat-offset-x.png.webp has a invalid UTF-8 byte sequence
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/utils.rb:19:in `block (2 levels) in read_unicode'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/utils.rb:13:in `tap'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/utils.rb:13:in `block in read_unicode'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/utils.rb:12:in `open'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/utils.rb:12:in `open'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/utils.rb:12:in `read_unicode'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/context.rb:188:in `evaluate'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/processed_asset.rb:12:in `initialize'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:374:in `new'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:374:in `block in build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:395:in `circular_call_protection'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:373:in `build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/index.rb:94:in `block in build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/caching.rb:58:in `cache_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/index.rb:93:in `build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:287:in `find_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/index.rb:61:in `find_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/bundled_asset.rb:16:in `initialize'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:in `new'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:in `build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/index.rb:94:in `block in build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/caching.rb:58:in `cache_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/index.rb:93:in `build_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/base.rb:287:in `find_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/index.rb:61:in `find_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:211:in `block in find_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:257:in `benchmark'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:210:in `find_asset'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:119:in `block in compile'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:in `each'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:in `compile'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-2.12.4/lib/rake/sprocketstask.rb:146:in `with_logger'
/Users/anton/.rvm/gems/ruby-2.2.3/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
/Users/anton/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
/Users/anton/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

When I disable it (config.assets.image_optim = false), all is fine.

@toy
Copy link
Owner

toy commented Jan 30, 2016

I've tried putting the first webp found in web without problems.
Is it possible for you to share the image causing problems, or does it happen with any webp image?

@thehappycoder
Copy link
Author

It choked on the first webp in my project. png, jpg files were ok
extra-no-repeat-offset-x.png.webp.zip

@stevenbarragan
Copy link

did you try?

npm install -g svgo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants