Skip to content

Commit cb9042f

Browse files
authored
Sync #4061 (#172)
1 parent a99a833 commit cb9042f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scripts/pnginfo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function getFlacMetadata(file: File): Promise<Record<string, string>> {
1414

1515
function parseExifData(exifData) {
1616
// Check for the correct TIFF header (0x4949 for little-endian or 0x4D4D for big-endian)
17-
const isLittleEndian = new Uint16Array(exifData.slice(0, 2))[0] === 0x4949;
17+
const isLittleEndian = String.fromCharCode(...exifData.slice(0, 2)) === "II";
1818

1919
// Function to read 16-bit and 32-bit integers from binary data
2020
function readInt(offset, isLittleEndian, length) {
@@ -117,6 +117,7 @@ export function getWebpMetadata(file) {
117117
let index = value.indexOf(":");
118118
txt_chunks[value.slice(0, index)] = value.slice(index + 1);
119119
}
120+
break;
120121
}
121122

122123
offset += 8 + chunk_length;

0 commit comments

Comments
 (0)