-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only capture the story #186
Comments
import React from 'react';
import MyComponent from './MyComponent';
export default {
title: 'MyComponent',
parameters: {
screenshot: {
viewport: {
width: 50,
height: 50,
},
},
},
};
export const normal = () => <MyComponent />; |
@samturrell jimp has an auto crop feature that will remove same color borders from an image. var regconfig = require("./regconfig.json");
var glob = require("glob");
const jimp = require("jimp");
const screenshotDir = regconfig.core.actualDir;
glob(`${screenshotDir}/**/*.png`, (err, files) => {
if (err) {
throw err;
}
files.forEach(file => {
jimp.read(file).then(image => {
image.autocrop({ cropOnlyFrames: false, tolerance: 0, leaveBorder: 5 });
image.write(file);
});
});
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to capture just the contents of the story and not the full 600x800 viewport?
For example i have an icon that's 35x35 but the story is extremely large in comparison. This means that when using with reg-suit with a threshold of
0.05
it doesn't detect the change.I've seen there's a
fullPage
option, but this doesn't seem to do anything from what i've experiencedThe text was updated successfully, but these errors were encountered: