decord/source/4907_getStringValue.js

33 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 4907
// Function ID: 4908
2026-07-29 08:29:29 +00:00
// Name: getStringValue
// Dependencies: []
2026-08-05 07:35:12 +00:00
// Module 4907 (getStringValue)
2026-07-29 08:29:29 +00:00
arg5.getStringValue = function getStringValue(value) {
const mapped = value.map((arg0) => String.fromCharCode(arg0));
return mapped.join("");
};
arg5.getEncodedString = function getEncodedString(arr) {
if (arr.length >= 8) {
const substr = arr.slice(0, 8);
const mapped = substr.map((arg0) => String.fromCharCode(arg0));
const joined = mapped.join("");
if ("ASCII\0\0\0" === joined) {
const substr1 = arr.slice(8);
const mapped1 = substr1.map((arg0) => String.fromCharCode(arg0));
return mapped1.join("");
} else if ("JIS\0\0\0\0\0" === joined) {
return "[JIS encoded text]";
} else if ("UNICODE\0" === joined) {
return "[Unicode encoded text]";
} else if ("\0\0\0\0\0\0\0\0" === joined) {
return "[Undefined encoding]";
}
}
return "Undefined";
};
arg5.getCalculatedGpsValue = function getCalculatedGpsValue(value) {
return value[0][0] / value[0][1] + value[1][0] / value[1][1] / 60 + value[2][0] / value[2][1] / 3600;
};