{"id":41914568,"url":"https://github.com/markdaws/open-thumbnailer","last_synced_at":"2026-01-25T16:19:42.336Z","repository":{"id":7495713,"uuid":"8845084","full_name":"markdaws/open-thumbnailer","owner":"markdaws","description":"A friendly wrapper around phantomjs to let you create webpage thumbnails in a headless environment","archived":false,"fork":false,"pushed_at":"2013-03-26T03:04:10.000Z","size":18008,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T23:03:51.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markdaws.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-18T01:52:57.000Z","updated_at":"2015-10-08T12:47:26.000Z","dependencies_parsed_at":"2022-08-27T03:24:51.160Z","dependency_job_id":null,"html_url":"https://github.com/markdaws/open-thumbnailer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markdaws/open-thumbnailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdaws%2Fopen-thumbnailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdaws%2Fopen-thumbnailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdaws%2Fopen-thumbnailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdaws%2Fopen-thumbnailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markdaws","download_url":"https://codeload.github.com/markdaws/open-thumbnailer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdaws%2Fopen-thumbnailer/sbom","scorecard":{"id":619839,"data":{"date":"2025-08-11","repo":{"name":"github.com/markdaws/open-thumbnailer","commit":"cea3fef8572b9acf099c278f2bb3cc1669a8bd1e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T04:56:32.205Z","repository_id":7495713,"created_at":"2025-08-21T04:56:32.205Z","updated_at":"2025-08-21T04:56:32.205Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-25T16:19:41.623Z","updated_at":"2026-01-25T16:19:42.322Z","avatar_url":"https://github.com/markdaws.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open-thumbnailer\n\n##Overview\nA friendly [node.js](www.nodejs.org) JavaScript wrapper around [phantomjs](http://phantomjs.org/) that lets you create webpage thumbnails in a headless environment with a few lines of code.  There are generally several things you want to do when creating a thumbnail:\n\n - Render the webpage as a PNG or JPG\n - Control the quality level of your saved thumbnail (for JPGs)\n - Resize the thumbnail\n - Crop the thumbnail\n - Copy / Delete / Rename thumbnails\n\nThe open-thumbnailer library makes all of this very easy.\n\n##Installation\n`npm install open-thumbnailer`\n\nTo use a lot of the functionality in the library you will need to install [graphicsmagick](http://www.graphicsmagick.org) as well.\n\n##Examples Thumbnails\nHere are some example thumbnails generated by this library:\n\n![](https://raw.github.com/markdaws/open-thumbnailer/master/examples/thumbs/apple.com.small.jpg)\n![](https://raw.github.com/markdaws/open-thumbnailer/master/examples/thumbs/amazon.com.small.jpg)\n\n\n![](https://raw.github.com/markdaws/open-thumbnailer/master/examples/thumbs/clipboard.com.small.jpg)\n![](https://raw.github.com/markdaws/open-thumbnailer/master/examples/thumbs/ebay.com.small.jpg)\n\nTo see some more thumbnails, look in the examples/thumbs directory.  You can run the examples/top.js example and generate these thumbs for yourself.\n\n##Thumbnailer Examples\n\n###Supported File Formats\nYou can save thumbnails as PNG of JPG files.  For JPG files you can also specify a quality value in the fromUrl options that affects the JPG quality.\n\nTo create a thumbnail it's really just a few lines of code.  For example to create a thumbnail for www.imdb.com you would do:\n\n```javascript\nvar OT = require('open-thumbnailer'),\n    thumbnailer = new OT.Thumbnailer();\n\nthumbnailer.fromUrl(\n    'http://www.imdb.com',\n    __dirname + '/imdb.com.jpg',\n    function(error, thumbnail) {\n\n        if (error) {\n            console.dir(error);\n            return;\n        }\n\n        console.dir(thumbnail.getInfo());\n    }\n);\n```\n\nAt any point you can cancel an in progress thumbnail\n```\nthumbnailer.cancel();\n```\n\nThere are various options you can specify to the thumbnailer when creating a thumb:\n```javascript\nvar OT = require('open-thumbnailer'),\n    thumbnailer = new OT.Thumbnailer();\n\nthumbnailer.fromUrl(\n    'http://www.imdb.com',\n\n    // To save as a PNG, simply change the file extension to PNG\n    __dirname + '/imdb.com.jpg',\n    {\n      // A number between 0 and 100 that specifies the quality of the jpg thumb.\n      // Only applies if you are creating jpgs, not pngs\n      quality: 75,\n\n      // If you don't specify an extension on the output path, then you must specify\n      // the format here, if you don't want the default of jpg.  Can be jpg, jpeg or png.\n      // This value will be ignored if the output path has an extension already set on\n      // it of png | jpg | jpeg\n      format: 'jpg',\n\n      // Can be true, which will use a simple internal console.log method\n      // to log status, or you can provide your own log object e.g.\n      log: {\n        verbose: function(message) { console.log(message); },\n        error: function(message, error) { console.error(JSON.stringify(error))}\n      },\n\n      // The amount of time to wait before cancelling the thumbnail.  If a page\n      // is taking a long time to load you may want to cancel\n      timeout: 60,\n\n      // The amount of time (in seconds) to wait after the page loads before actually\n      // trying to render the page.  There may be cases where the page loads content\n      // asyncronously and if you render straight away on load the page may not have\n      // all the content.\n      delay: 10,\n\n      // The size of the window when the page is loaded.  This is not a crop size it\n      // is the size of the browser window to use when loading the content.  Content loaded\n      // outside of these values will still be rendered in the final thumb.  If you want\n      // to crop then use the crop value as specified below\n      viewport: { width: 1024, height: 768 },\n\n      // The part of the page to render. The interesting part here is cropToPage, if this\n      // is false then if the rendered webpage is smaller than the crop region the thumbnail\n      // will still be as big as the crop region with pixels filled in black, however if you\n      // set cropToPage:true, then if the webpage is smaller than the crop size the thumbnail\n      // will be the same size as the page.\n      crop: { top:0, left:0, width: 1024, height: 400, cropToPage: true }\n    },\n    function(error, thumbnail) {\n\n        if (error) {\n            console.dir(error);\n            return;\n        }\n\n        console.dir(thumbnail.getInfo());\n    }\n);\n```\n\n##Thumbnail Examples\nOnce you have generated a thumbnail, you will have a Thumbnail instance, there are several methods available to you:\n\n###getInfo -\u003e returns basic information about the thumbnail\n```javascript\nvar info = thumb.getInfo();\nconsole.log(info.width + 'x' + info.height + ' at ' + info.path + ' ' + info.size + ' bytes');\n```\n\n###destroy -\u003e deletes the thumbnail from the disk\n```javascript\nthumb.destroy(function(error) {\n  console.dir(error);\n});\n```\n\n###copy -\u003e creates a copy of the thumbnail on disk\n```javascript\nthumb.copy('some-new-file-name.jpg', function(error, copyOfThumb) {\n  console.log(copyOfThumb.getInfo().path);\n});\n```\n\n###move -\u003e moves the thumbnail on disk\n```javascript\nthumb.move('new-file-location.jpg', function(error) {\n  console.dir(error);\n});\n```\n\n###resize -\u003e resizes and potentially crops the thumbnail\n```javascript\nthumb.resize(\n  {\n    // scales the thumbnail to 400 pixels wide, the aspect ratio of the clip\n    // will be maintained\n    scaleToWidth: 400,\n\n    // scales the thumbnail to 600 pixels tall.  Only specify one of scaleToWidth\n    // and scaleToHeight, if both are specified the behaviour is unspecified\n    scaleToHeight: 600,\n\n    // Optional - if not specified the thumb will be resized and the original\n    // thumb variable points to the resized thumb.  If you specify a targetPath\n    // then a copy of the thumb is made and resized and the copied thumb is\n    // returned in the callback\n    targetPath: 'some-new-file.jpg',\n\n    // crops the thumbnail AFTER it has been resized, so for example if you set\n    // scaleToWidth to 400 and wanted a square thumbnail, you could then crop the\n    // height to 400 pixels here to make the output square\n    crop: { top:0, left: 0, width: 400, height: 400 }\n\n  },\n  function(error, resizedThumb) {\n    // NOTE: resizedThumb will be null if you did not specify a targetpath\n    // in the options\n  }\n);\n```\n\n\n\n\n## Development\n1. Install GraphicsMagick http://www.graphicsmagick.org/   (sudo port install graphicsmagick)\n\n```shell\ngit clone https://github.com/markdaws/open-thumbnailer.git\ncd open-thumbnailer\nnpm install\nnpm test\n\n\nnode examples/top.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdaws%2Fopen-thumbnailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkdaws%2Fopen-thumbnailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdaws%2Fopen-thumbnailer/lists"}