87 lines
2.2 KiB
JavaScript
87 lines
2.2 KiB
JavaScript
// Metro module 4820 (f4821).
|
|
import Module4819 from "./Module4819";
|
|
export default {
|
|
read: function read(a0, a1) {
|
|
const shortAt = Module4819.getShortAt(a0, a1);
|
|
const r3 = 15 > shortAt;
|
|
let r10 = void 0;
|
|
if (!r3) {
|
|
const byteAt = Module4819.getByteAt(a0, a1 + 14);
|
|
r10 = {
|
|
value: byteAt,
|
|
description: `${byteAt}px`
|
|
};
|
|
}
|
|
const r31 = 16 > shortAt;
|
|
let r32 = void 0;
|
|
if (!r31) {
|
|
const byteAt2 = Module4819.getByteAt(a0, a1 + 15);
|
|
r32 = {
|
|
value: byteAt2,
|
|
description: `${byteAt2}px`
|
|
};
|
|
}
|
|
const r45 = 9 > shortAt;
|
|
let r46 = void 0;
|
|
if (!r45) {
|
|
const byteAt4 = Module4819.getByteAt(a0, a1 + 7);
|
|
const byteAt5 = Module4819.getByteAt(a0, a1 + 7 + 1);
|
|
r46 = {
|
|
value: 256 * byteAt4 + byteAt5,
|
|
description: byteAt4 + "." + byteAt5
|
|
};
|
|
}
|
|
const r68 = 10 > shortAt;
|
|
let r69 = void 0;
|
|
if (!r68) {
|
|
const byteAt3 = Module4819.getByteAt(a0, a1 + 9);
|
|
r69 = {
|
|
value: byteAt3,
|
|
description: byteAt3 !== 0 ? byteAt3 !== 1 ? byteAt3 === 2 ? "cm" : "Unknown" : "inches" : "None"
|
|
};
|
|
}
|
|
const r81 = 12 > shortAt;
|
|
let XResolution = void 0;
|
|
if (!r81) {
|
|
const shortAt2 = Module4819.getShortAt(a0, a1 + 10);
|
|
XResolution = {
|
|
value: shortAt2,
|
|
description: "" + shortAt2
|
|
};
|
|
}
|
|
const r91 = 14 > shortAt;
|
|
let YResolution = void 0;
|
|
if (!r91) {
|
|
const shortAt3 = Module4819.getShortAt(a0, a1 + 12);
|
|
YResolution = {
|
|
value: shortAt3,
|
|
description: "" + shortAt3
|
|
};
|
|
}
|
|
const r66 = {
|
|
"JFIF Version": r46,
|
|
"Resolution Unit": r69,
|
|
XResolution,
|
|
YResolution,
|
|
"JFIF Thumbnail Width": r10,
|
|
"JFIF Thumbnail Height": r32
|
|
};
|
|
if (r10 !== void 0 && r32 !== void 0) {
|
|
const r104 = 3 * r10.value * r32.value;
|
|
const r106 = r104 !== 0 ? 16 + r104 > shortAt ? void 0 : {
|
|
value: a0.buffer.slice(a1 + 16, a1 + 16 + r104),
|
|
description: "<24-bit RGB pixel data>"
|
|
} : void 0;
|
|
if (r106) {
|
|
r66["JFIF Thumbnail"] = r106;
|
|
}
|
|
}
|
|
for (const key in r66) {
|
|
if (r66[key] === void 0) {
|
|
delete r66[key];
|
|
}
|
|
}
|
|
return r66;
|
|
}
|
|
};
|