Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
crash13override committed Nov 12, 2024
1 parent 2c91d33 commit 9acbd33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
on:
branch: master
tags: true
repo: anishkny/webgif
repo: crash13override/webgif2
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const pngFileStream = require('png-file-stream');
const puppeteer = require('puppeteer');
const tempdir = require('tempdir');

const screenSize = 480;
const screenSizeW = 1024;
const screenSizeH = 1350;

const argv = require('yargs')
.alias('url', 'u').default('url', 'https://giphy.com/search/lol')
Expand All @@ -26,7 +27,7 @@ const argv = require('yargs')
.describe('type', 'Image output format (gif/png)')
.alias('h', 'help')
.alias('V', 'version')
.usage('webgif -u URL -d DURATION [-o OUTFILE] [-l DELAY] [-f FRAMES] [-q QUALITY] [-t TYPE]')
.usage('webgif2 -u URL -d DURATION [-o OUTFILE] [-l DELAY] [-f FRAMES] [-q QUALITY] [-t TYPE]')
.version()
.argv;

Expand All @@ -39,8 +40,8 @@ const argv = require('yargs')
const workdir = await tempdir();

page.setViewport({
width: screenSize,
height: screenSize,
width: screenSizeW,
height: screenSizeH,
});

console.log(`Navigating to URL: ${argv.url}`);
Expand Down Expand Up @@ -68,7 +69,7 @@ const argv = require('yargs')
await Promise.all(screenshotPromises);
if(argv.type == 'gif'){
console.log(`\nEncoding GIF: ${argv.output}`);
const encoder = new GIFEncoder(screenSize, screenSize);
const encoder = new GIFEncoder(screenSizeW, screenSizeH);
await pngFileStream(`temp/${argv.output}/T*png`)
.pipe(encoder.createWriteStream({ repeat: 0, delay: argv.frames, quality: argv.quality }))
.pipe(fs.createWriteStream(`${argv.output}.gif`));
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Settings]
ID = "webgif"
ID = "webgif2"

[build]
publish = "website/"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "webgif",
"name": "webgif2",
"version": "1.1.0",
"description": "Easily generate animated GIFs from websites",
"main": "index.js",
"bin": {
"webgif": "./index.js"
"webgif2": "./index.js"
},
"scripts": {
"test": "nyc -r text -r html -r lcov mocha",
Expand All @@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/anishkny/webgif.git"
"url": "git+https://github.com/crash13override/webgif2.git"
},
"keywords": [
"gif",
Expand All @@ -25,9 +25,9 @@
"author": "Anish Karandikar <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/anishkny/webgif/issues"
"url": "https://github.com/crash13override/webgif2/issues"
},
"homepage": "https://github.com/anishkny/webgif#readme",
"homepage": "https://github.com/crash13override/webgif2#readme",
"dependencies": {
"gifencoder": "^1.1.0",
"png-file-stream": "^1.0.0",
Expand Down

0 comments on commit 9acbd33

Please sign in to comment.