Skip to content

Commit

Permalink
fix: migrate to new resvg-js version
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGolms committed Jun 6, 2022
1 parent cf9a90c commit cc6e63e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/image.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { render } from '@resvg/resvg-js';
import { Resvg } from '@resvg/resvg-js';
import { CreateImage } from '../types';

export const createImage = async ({ svg, zoom = 5 }: CreateImage): Promise<Buffer> => {
return render(svg, {
const resvg = new Resvg(svg, {
fitTo: {
mode: 'zoom',
value: zoom,
},
});

return resvg.render().asPng();
};

0 comments on commit cc6e63e

Please sign in to comment.