Handle stds:exif C2PA assertions
This commit is contained in:
parent
ed79b3186a
commit
5c559a98ad
3 changed files with 128 additions and 66 deletions
|
|
@ -1040,6 +1040,24 @@ class Util {
|
|||
return then.format("lll");
|
||||
}
|
||||
|
||||
parseExifDate(exifDateString) {
|
||||
// Use a regular expression to match and capture the date/time components.
|
||||
const regex = /(\d{4}):(\d{2}):(\d{2})\s(\d{2}):(\d{2}):(\d{2})/;
|
||||
const match = exifDateString.match(regex);
|
||||
|
||||
if (match) {
|
||||
// Extract components and convert to numbers. Note that months are 0-indexed.
|
||||
const year = parseInt(match[1], 10);
|
||||
const month = parseInt(match[2], 10) - 1;
|
||||
const day = parseInt(match[3], 10);
|
||||
const hour = parseInt(match[4], 10);
|
||||
const minute = parseInt(match[5], 10);
|
||||
const second = parseInt(match[6], 10);
|
||||
return new Date(year, month, day, hour, minute, second);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
browserCanRecordAudio() {
|
||||
return _browserCanRecordAudio;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue