yahooarchive / pngjs-image Goto Github PK
View Code? Open in Web Editor NEWJavaScript-based PNG image encoder, decoder, and manipulator
Home Page: http://yahoo.github.io/pngjs-image
License: MIT License
JavaScript-based PNG image encoder, decoder, and manipulator
Home Page: http://yahoo.github.io/pngjs-image
License: MIT License
hi,
maybe I miss something out - but it looks like that loading a PNG from a http URL instead of local filesystem does not work ... any hints on that ?
I'm using blink-diff and i got this error. Why is it this.log
??
/Users/thomas/Desktop/goldshelf/node_modules/blink-diff/node_modules/pngjs-image/index.js:24
this.log(err.message);
^
TypeError: undefined is not a function
at PNGImage.<anonymous> (/Users/thomas/Desktop/goldshelf/node_modules/blink-diff/node_modules/pngjs-image/index.js:24:14)
at emitOne (events.js:82:20)
at emit (events.js:166:7)
at emitOne (events.js:82:20)
at emit (events.js:166:7)
at Parser._parseSignature (/Users/thomas/Desktop/goldshelf/node_modules/blink-diff/node_modules/pngjs-image/node_modules/pngjs/lib/parser.js:87:18)
at ChunkStream._process (/Users/thomas/Desktop/goldshelf/node_modules/blink-diff/node_modules/pngjs-image/node_modules/pngjs/lib/chunkstream.js:186:23)
at ChunkStream.write (/Users/thomas/Desktop/goldshelf/node_modules/blink-diff/node_modules/pngjs-image/node_modules/pngjs/lib/chunkstream.js:74:10)
at PNG.write (/Users/thomas/Desktop/goldshelf/node_modules/blink-diff/node_modules/pngjs-image/node_modules/pngjs/lib/png.js:100:18)
at ReadStream.ondata (_stream_readable.js:524:20)
thomas@workstation:goldshelf$
The latest pngjs supports node >= v4;
https://github.com/lukeapage/pngjs/blob/b495e60323125cd3f2dcd64c56fa0182b9b49c65/package.json#L30
The version pngjs-image is using requires node v0.8:
https://github.com/lukeapage/pngjs/blob/82dd9a96c00eabb2b9051edb6d7b45fed944111d/package.json#L12
Please upgrade pngjs to a newer version so that it can be installed under the yarn
package manager on new node.js engines, if possible.
(I ❤️ blink-diff yahoo/blink-diff#32)
I would like to create a png file from a single Uint8Array rather than using the set methods.
Similarly, would be great to get the png data as a Uint8Array.
But creation is more important for me, I use webgl textures and framebuffers to decode pngs.
Has anyone run into this error before?
TypeError: this._inflate.destroy is not a function
at Parser._handleError (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\parser.js:72:23)
at emitOne (events.js:82:20)
at emit (events.js:169:7)
at Parser._parseChunkEnd (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\parser.js:146:14)
at ChunkStream._process (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\chunkstream.js:186:23)
at ChunkStream.read (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\chunkstream.js:51:10)
at Parser._handleChunkEnd (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\parser.js:136:10)
at Parser._parseIEND (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\parser.js:326:10)
at ChunkStream._process (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\chunkstream.js:186:23)
at ChunkStream.read (c:\Projects\Architecture\InnovationProjects\SignatureImageHelper\node_modules\pngjs-image\node_modules\pngjs\lib\chunkstream.js:51:10)
Trying to open a png image.
I see you are using pngjs for reading and writing png's. That project has been dead a couple of years and I've been working on a replacement - pngjs2, including the bugfixes, which is fully tested and supports multiple bit depths and interlace.
The version of pngjs being used is out of date and has a lot of bugs. The current version should be used instead. I tested running with the current version and nothing seemed to break so it should be pretty easy to change.
blink-diff test/screenshots/1280x800/actual/1.png test/screenshots/1280x800/expected/1.png Blink-Diff 1.0.10 Copyright (C) 2014 Yahoo! Inc. TypeError: Object # has no method '_readImageFromFs' at PNGImage.readImage (/Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/pngjs-image/index.js:114:15) at /Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/promise/lib/node-extensions.js:25:10 at doResolve (/Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/promise/lib/core.js:91:5) at new Promise (/Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/promise/lib/core.js:71:3) at /Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/promise/lib/node-extensions.js:17:12 at Object.BlinkDiff._loadImage (/Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/index.js:704:48) at Object.promise.then.then._imageA (/Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/index.js:355:16) at /Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/promise/lib/es6-extensions.js:18:19 at flush (/Users/sureshkm/.nvm/v0.10.33/lib/node_modules/blink-diff/node_modules/promise/node_modules/asap/asap.js:27:13) at process._tickCallback (node.js:419:13)
Should be a way to get image as base64.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.