docs = exiftooloutput
.split(/ \| \d+\) /)
.filter( s => s.match('EmbeddedImage') )
.map( (s, i) => {
const matchedRect = s.match(/EmbeddedImageRectangle = (\d+) (\d+) (\d+) (\d+)/);
let x1, y1, x2, y2;
if (matchedRect) {
[,x1,y1,x2,y2] = s.match(/EmbeddedImageRectangle = (\d+) (\d+) (\d+) (\d+)/);
}
const imgclass = s.match(/EmbeddedImageClass = (.+)/)?.at(1);
return {
url: prefix + ( i + 1 ) + suffix,
x1,
y1,
x2,
y2,
imgclass
}
} )