Code Monkey home page Code Monkey logo

capture-screenshot's Issues

Getting error ssl

"phantomjs --ignore-ssl-errors=true --ssl-protocol=sslv3

How to fix that error.

when cant find website

Hello,
When a website can't be found
example screenshot("http://www.dfdsafdsfdscascdasc12xc.com")
The program just hangs.
Is there a property or method that can be set to exit or throw error after certain time has passed trying to get the website.
The current timeout(3000) is only for waiting for site to load then get snapshot.
Thanks

Feature (Pixel Ratio)

Please allow for control of pixel ratio for higher quality of screenshots without changing breakpoints. For example a screen shot of 400x600 * 2pr would yield a 800*1200 image but still have mobile breakpoint activated.

The filename, directory name, or volume label syntax is incorrect

Followed the example.

  1. Installed: npm install capture-screenshot --save
  2. Ran the example:
const capture = require('capture-screenshot');
const fs = require('fs');

capture({url: 'https://twitter.com/'})
  .then(imgs => {
    fs.writeFileSync('chrome.png', imgs.chrome);
    fs.writeFileSync('electron.png', imgs.electron);
    fs.writeFileSync('phantomjs.png', imgs.phantomjs);
  });

But got error:

(node:9444) UnhandledPromiseRejectionWarning: Error: Command failed: 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\electron\dist\electron.exe' 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\capture-electron/script/render.js' 'https://twitter.com/' 1024 768 0 png
The filename, directory name, or volume label syntax is incorrect.

  at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)
(node:9444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I noticed that this package installed capture-electron but this error says it tries to access node_modules\electron. Could that be the reason?

Just for giggles, i installed electron and i got slitly different error:

(node:33936) UnhandledPromiseRejectionWarning: Error: Command failed: 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\capture-electron\node_modules\electron\dist\electron.exe' 'C:\Users\PragmaticEd\workspace\_private\TestApp\node_modules\capture-electron/script/render.js' 'https://twitter.com/' 1024 768 0 png
The filename, directory name, or volume label syntax is incorrect.

    at ChildProcess.exithandler (child_process.js:289:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)
(node:33936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:33936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Note how, before i installed electron, it was checking for node_modules\electron\dist\electron.exe, but after i installed electron, it started checking: node_modules\capture-electron\node_modules\electron\dist\electron.exe

Platform: WIndows 10

SVG not support

When i screenshot the url that contain with avg files, the avg not showing the right way , some are missing and some are not full image load. thanks

Running on ubuntu server, will I need to install an x server?

I'm creating a discord bot. One of its features is the ability to grab a screnshot from http://jef.works/picture-quote-generator and paste that in your current channel. The bot is running on an ubuntu server, but appears to be genorating white squares with question marks like this
note: this IS in my bot startup script, I copied and pasted it from a phantomjs thread due to another error it was throwing: QT_QPA_PLATFORM=offscreen

Code genorating these white squares:

screenshot('http://jef.works/picture-quote-generator/')
 .width(800)
 .height(600)
 .capture(function(err, img) {
   if (err) throw err;
   file = Math.round((new Date()).getTime() / 1000);
   fs.writeFileSync('/var/www/html/host/gcore/quotes/'+file+'.png', img);

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Allow to use phantomjs from npm

It looks a bit more convenient use npm version of phantomjs.
Need just instead exec('phantomjs use

var phantomjs = require('phantomjs')
var binPath = phantomjs.path

exec(binPath

Or something like this (i did not check).

Thanks

How to make screenshot.capture() synchronous ?

I have list of urls and want to process them line by line, but by default url-to-screenshot process them asynchronously which highly resource consumed when all url being captured together at the same time (even hang my pc in my case).

is the any way to call capture() synchronously ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.