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

MiniMagick::Error for some sites #7

Open
arsenische opened this issue Sep 24, 2014 · 3 comments
Open

MiniMagick::Error for some sites #7

arsenische opened this issue Sep 24, 2014 · 3 comments

Comments

@arsenische
Copy link

Thanks for a great gem! I used it to fetch images of thousands of sites. But for some sites it always returns the following error:

Webshot::Screenshot.instance.capture("http://bitcoinplanet.yolasite.com/", "/tmp/thumb.png")
MiniMagick::Error: Command ("identify -quiet -ping /tmp/mini_magick20140924-2486-17g09z6.png") failed: {:status_code=>1, :output=>"identify.im6: improper image header `/tmp/mini_magick20140924-2486-17g09z6.png' @ error/png.c/ReadPNGImage/3675.\n"}
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:381:in `run'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:363:in `run_command'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:171:in `valid?'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:140:in `create'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:48:in `read'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:111:in `block in open'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:110:in `open'
    from <...>/bundle/ruby/2.0.0/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:110:in `open'
    from <...>/bundle/ruby/2.0.0/gems/webshot-0.0.7/lib/webshot/screenshot.rb:56:in `capture'
    from (irb):2
    from <...>/bundle/ruby/2.0.0/gems/railties-3.2.19/lib/rails/commands/console.rb:47:in `start'
    from <...>/bundle/ruby/2.0.0/gems/railties-3.2.19/lib/rails/commands/console.rb:8:in `start'
    from <...>/bundle/ruby/2.0.0/gems/railties-3.2.19/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

ruby 2.0
phantomjs 1.9.7
webshot 0.0.7
capybara 2.4.3
poltergeist 1.5.1
ubuntu 14.04.1 LTS

@arsenische
Copy link
Author

The error disappears if to remove ":full => true" from

page.driver.save_screenshot(tmp.path, :full => true)

Perhaps it just doesn't have enough memory to create an image file?

@vitalie
Copy link
Owner

vitalie commented Mar 5, 2015

Hi Arsen,

I'm busy this week, I'll take a look at this issue on Monday.

Thank you,
Vitalie

@rgo
Copy link
Contributor

rgo commented Sep 16, 2015

@arsenische try the new version with the updated mini_magick and poltergeist (it worked for us)

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