Comments (3)
Hi, the error is caused by reasembleJS
and it's because it only supports .png
files (I'm not sure if other formats with transparency are supported but neither .jpg
nor .webm
are one of them). You need transparency to create a diff, but I guess we could work with white or black backgrounds as well. I could try to rewrite that part of the code and replace transparency with a solid background. Let me look at that over the weekend.
from puppeteer-screenshot-tester.
saw that, figured you knew the guy working on node-resemble.js ;)
Unfortunately I don't see any npm package for webp as straight forward as pngjs, but webp does support alpha https://developers.google.com/speed/webp/gallery2 so in theory it should be able to do everything you can with PNG at a much smaller file size; JPG is out of luck in that regard though.
In the context of puppeteer-screenshot-tester you know that you have chrome, so perhaps could leverage some canvas APIs? i.e. https://stackoverflow.com/a/55896125
I could see the case for even converting webp & jpg to PNG before sending them to resemble, then converting the diff to the desired output on the way back.
p.s. thanks for the quick response!
from puppeteer-screenshot-tester.
Fixed in v1.5.0.
Additionally, there is a new option to change the default compression levels for images. This might help with reducing the size if you want.
from puppeteer-screenshot-tester.
Related Issues (11)
- Setting the optional threshold allows failing screenshots to pass
- failing tests HOT 2
- include rectangle HOT 3
- Test passes when screenshots are different HOT 11
- ignoreRectangles == ignore an area when compared screenshot?
- Cannot update to 1.3.0 HOT 1
- includeRectangles now working with array.
- [BUG] PNG output forced into indexed color
- Passed througth options path is ignored HOT 2
- Option 'type' appears to be ignored? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppeteer-screenshot-tester.