{"_id":"@asutrick/react-pdf-png-js","_rev":"1-1b6259e6ba9f223f1530f8158e311f04","name":"@asutrick/react-pdf-png-js","dist-tags":{"latest":"2.2.0"},"versions":{"2.2.0":{"name":"@asutrick/react-pdf-png-js","version":"2.2.0","author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"license":"MIT","_id":"@asutrick/react-pdf-png-js@2.2.0","maintainers":[{"name":"asutrick","email":"austindsutrick@gmail.com"}],"homepage":"https://github.com/diegomura/react-pdf#readme","bugs":{"url":"https://github.com/diegomura/react-pdf/issues"},"dist":{"shasum":"7c24e9548354bad350c073aaf2ccfb7d2fbdd55e","tarball":"https://registry.npmjs.org/@asutrick/react-pdf-png-js/-/react-pdf-png-js-2.2.0.tgz","fileCount":7,"integrity":"sha512-Cjyk8uchviaY8vIldcWhY+V7SnNno57d6EM1ZBdYbRVdoONHZ46qYUpqzq11ShWY6jKUicH1Aw++KoMmvkI78Q==","signatures":[{"sig":"MEUCIHh9lolWTxwg1LW0DQ67QM10zy4oggBjmjCmipQ9NJa/AiEAuzfrZyHsfDvkw9AoFtOi3beSJ4zduEtjwjdjdz2+Hrs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1171915},"main":"./lib/png-js.cjs.js","module":"./lib/png-js.es.js","browser":{"./lib/png-js.es.js":"./lib/png-js.browser.es.js","./lib/png-js.cjs.js":"./lib/png-js.browser.cjs.js"},"gitHead":"13b143f477b090774e1af12e4f12974119defd38","scripts":{"build":"rimraf ./lib && rollup -c","watch":"rimraf ./lib && rollup -c -w"},"_npmUser":{"name":"asutrick","email":"austindsutrick@gmail.com"},"repository":{"url":"git+https://github.com/diegomura/react-pdf.git","type":"git","directory":"packages/png-js"},"_npmVersion":"8.5.5","description":"A PNG decoder in JS","directories":{},"_nodeVersion":"16.15.0","dependencies":{"browserify-zlib":"^0.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-pdf-png-js_2.2.0_1703259862523_0.44278943709267526","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2023-12-22T15:44:22.463Z","modified":"2024-08-19T20:23:56.551Z","2.2.0":"2023-12-22T15:44:22.765Z"},"bugs":{"url":"https://github.com/diegomura/react-pdf/issues"},"author":{"url":"http://badassjs.com/","name":"Devon Govett","email":"devongovett@gmail.com"},"license":"MIT","homepage":"https://github.com/diegomura/react-pdf#readme","repository":{"url":"git+https://github.com/diegomura/react-pdf.git","type":"git","directory":"packages/png-js"},"description":"A PNG decoder in JS","maintainers":[{"name":"asutrick","email":"austindsutrick@gmail.com"}],"readme":"<p align=\"center\">\r\n  <img src=\"https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png\" height=\"280px\">\r\n</p>\r\n\r\n# @react-pdf/png-js\r\n\r\nA PNG decoder in JS for the canvas element or Node.js.\r\n\r\n## Acknowledges\r\n\r\nThis project is a fork of [png.js](https://github.com/foliojs/png.js) by @devongovett and continued under the scope of this project since it has react-pdf specific features. Any recongnition should go to him and the original project mantainers.\r\n\r\n## About this fork\r\n\r\n> Updated to 977b857a11676c1e720e79ed8d9178a005a9abd6\r\n\r\n- Build node and browser specific bundles\r\n- Uses rollup for build\r\n## Browser Usage\r\n\r\nSimply include png.js and zlib.js on your HTML page, create a canvas element, and call PNG.load to load an image.\r\n\r\n    <canvas></canvas>\r\n    <script src=\"zlib.js\"></script>\r\n    <script src=\"png.js\"></script>\r\n    <script>\r\n        var canvas = document.getElementsByTagName('canvas')[0];\r\n        PNG.load('some.png', canvas);\r\n    </script>\r\n\r\nThe source code for the browser version resides in `png.js` and also supports loading and displaying animated PNGs.\r\n\r\n## Node.js Usage\r\n\r\nInstall the module using npm\r\n\r\n    sudo npm install png-js\r\n\r\nRequire the module and decode a PNG\r\n\r\n    var PNG = require('png-js');\r\n    PNG.decode('some.png', function(pixels) {\r\n        // pixels is a 1d array (in rgba order) of decoded pixel data\r\n    });\r\n\r\nYou can also call `PNG.load` if you want to load the PNG (but not decode the pixels) synchronously.  If you already\r\nhave the PNG data in a buffer, simply use `new PNG(buffer)`.  In both of these cases, you need to call `png.decode`\r\nyourself which passes your callback the decoded pixels as a buffer.  If you already have a buffer you want the pixels\r\ncopied to, call `copyToImageData` with your buffer and the decoded pixels as returned from `decodePixels`.\r\n","readmeFilename":"README.md"}