mohan-bee/infrared-battle-tag
A compact board featuring an ATtiny1616 microcontroller, tactile switch, and MMBT2222A transistor, with VCC/GND power and the switch connected to the MCU’s PA4 input.
- Version
- 1.0.2
- License
- unset
- Stars
- 0
evidence/make-crops.ts
import sharp from "sharp"
import { mkdir } from "node:fs/promises"
await mkdir("evidence/images", { recursive: true })
const repro = await sharp("dist/evidence/import-repro/schematic.svg", { density: 216 }).resize(3600, 1800).png().toBuffer()
for (const [name, left, top, width, height] of [
["mcu-missing-aliases", 80, 150, 300, 310],
["switch-missing-terminal", 550, 240, 290, 150],
["transistor-label-collision", 1050, 210, 150, 200],
] as const) {
await sharp(repro).extract({left:left*3, top:top*3, width:width*3, height:height*3}).toFile(`evidence/images/${name}.png`)
}
await sharp("dist/index/schematic.svg", {density:216}).resize(3600).png().toFile("schematic.png")
await sharp("dist/index/pcb.svg", {density:216}).resize(2400).png().toFile("pcb.png")
await sharp("schematic.png").extract({left:855, top:350, width:1845, height:1100}).toFile("evidence/images/missing-kicad-child-content.png")