Topic: CutyCapt Screenshot

Why if I execute the next code in IRB it works, but if I run it from website it doesnt?
system  xvfb-run --server-args='-screen 0, 1024x768x24' CutyCapt --url=http://example.com --out=public/images/thumbs/13.jpg

Re: CutyCapt Screenshot

Try the CapIt gem, it works.

https://github.com/ezkl/capit

It's probably because the CutyCapt / cutycapt command is named differently at your server. Don't know why they did it like this.

Last edited by lbunk (2013-05-02 19:48:46)

Re: CutyCapt Screenshot

Thanks!
Hey, Im doing this

require "capit"
capit = CapIt::Capture("http://sitepoint.com",:filename => "mdvlrb.jpg")

But it doesnt create the image, and capit doesnt throw nothing.
But when I execute it in the IRB console, it creates the image...

I dont know what to do.

Re: CutyCapt Screenshot

Try setting :folder => to a folder you know and then see if it creates the image there. Default is Dir.pwd.

Re: CutyCapt Screenshot

I use this in the controller

capit = CapIt::Capture("http://www.sitepoint.com/",:filename => "mdvlrb.jpg",:folder => "public/images/thumbs")

And I get nothing.

I use the same directly in IRB console and I get the image.

Re: CutyCapt Screenshot

If I use this

capit = CapIt::Capture.new("http://www.sitepoint.com/",:filename => "mdvlrb.jpg",:folder => "public/images/thumbs")
capit.capture

I get this in the log:  #<CapIt::Capture:0x00000003868c30>
but no image.

Re: CutyCapt Screenshot

Dammit...
It was the permissions in the folder...
Thats weird, because I can execute system("mkdir newfolder") but not system("wkhtmltoimage") or CaptIt..