...

Package png

import "oss.terrastruct.com/d2/lib/png"
Overview
Index

Overview ▾

Constants

ConvertSVG scales the image by 2x

const SCALE = 2.

func AddExif

func AddExif(png []byte) ([]byte, error)

func ConvertSVG

func ConvertSVG(page playwright.Page, svg []byte) ([]byte, error)

ConvertSVG converts the given SVG into a PNG. Note that the resulting PNG has 2x the size (width and height) of the original SVG (see generate_png.js)

type Playwright

type Playwright struct {
    PW      *playwright.Playwright
    Browser playwright.Browser
    Page    playwright.Page
}

func InitPlaywright

func InitPlaywright() (Playwright, error)

func (*Playwright) Cleanup

func (pw *Playwright) Cleanup() error

func (*Playwright) RestartBrowser

func (pw *Playwright) RestartBrowser() (Playwright, error)