fzaninotto / screenshot-as-a-service

Website screenshot service powered by node.js and phantomjs
1.1k stars 243 forks source link

Service fails when width is specified #52

Open gihrig opened 10 years ago

gihrig commented 10 years ago

Running under Mac OS X 10.6.8

I installed as instructed below. The first example works as expected.

When I try

$ curl http://localhost:3000/?url=www.google.com&width=800&height=600 > google.png

It appears that maybe the image data is being dumped to the console. In any case, the output file is created, but contains zero bytes.

The console output (abbreviated):

dev:screenshot-as-a-service glen$ curl http://localhost:3000/?url=www.google.com&width=800&height=600 > google.png
[1] 5679
[2] 5680
dev:screenshot-as-a-service glen$ #PNG

IHDR######d#IT  pHYs

                    ## IDATx###w#Uս######g###J#
                                               v#####g4M###$57Ɩ####_######xը##1#`##JS)#A#t########g
                                                                                                   }#3s`###<x0####s####Y##Yf#########
                                                                                                                                     r݄6################8x###f###"""""""Y #######r9##R#T###
                                      ##
                                        c#############e
#"""""""mH#N@#N 

<snip>

#
#
#
##h4           #Y##IEND#B`#

Here the process 'hangs', that is, no change is observed for a few minutes. Aborting the process with Ctrl-C adds the following and returns to the prompt.

[1]-  Done                    curl http://localhost:3000/?url=www.google.com
[2]+  Done                    width=800
dev:screenshot-as-a-service glen$ 

Any ideas or troubleshooting suggestions would be most welcomed!

deepak1556 commented 10 years ago

Need to run it with quotes otherwise the shell considers & as end of command. So the right way is

curl "http://localhost:3000/?url=www.google.com&width=800&height=600" > google.png