diff --git a/src/app.jsx b/src/app.jsx index b06447f..b4a79ad 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -4,7 +4,7 @@ import { compact, map } from 'lodash'; import visualCenter from './visualCenter.js'; import demoImage from './assets/demo.js'; -// import { downloadCenteredImage } from './lib/imglib'; +import { downloadCenteredImage } from './lib/imglib.js'; import { MainHeader, @@ -242,6 +242,21 @@ function App() { +
+ +
+ + + 0.5 ? 0 : canvas.width - img.width, y > 0.5 ? 0 : canvas.height - img.height ); - // // draw in the dom - // const img2 = new Image(); - // img2.src = canvas.toDataURL('image/png'); - // img2.style.border = '1px solid red'; - // document.body.appendChild(img2); - const a = document.createElement('a'); a.href = canvas.toDataURL('image/png'); - a.download = 'image.png'; + a.download = 'image-centered.png'; a.click(); }; }