You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I'm having the same problem with whatsapp videos I backed up. I temporarily solved the problem by making an arrangement like this. I didn't do detailed research. I don't know where the real problem is.
I edited the getDateTaken function in apps/memories/lib/exif.php like this and indexed again with
occ memories:index --clear command.
publicstaticfunctiongetDateTaken(File$file, array$exif): \DateTime
{
// If it is a WhatsApp video, pull the date from the file name$filename = $file->getName(); // editif (preg_match('/VID-(\d{8})-WA\d+/', $filename, $matches)) {
$dateStr = $matches[1];
try {
$dt = \DateTime::createFromFormat('Ymd', $dateStr);
// timezone settings$tz = getenv('TZ') ?: date_default_timezone_get();
$dt->setTime(12, 0); we give a fixed time because there is no time information in the file
$dt->setTimezone(new \DateTimeZone($tz));
return$dt;
} catch (\Exception) {
// If the file name is wrong, return to normal EXIF
}
}
// Try with normal EXIF datetry {
$date = self::parseExifDate($exif);
if ($date->getTimestamp() === -2082844800) {
thrownew \Exception("Blacklisted date, fallback to mtime");
}
return$date;
} catch (\Exception) {
} catch (\ValueError) {
}
// If the date is still not found, use the time the file was modified$dt = new \DateTime('@'.$file->getMtime());
$tz = getenv('TZ') ?: date_default_timezone_get();
try {
$dt->setTimezone(new \DateTimeZone($tz));
} catch (\Exception) {
thrownew \Error("FATAL: system timezone is invalid (TZ): {$tz}");
}
return$dt;
}
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
On some video files, the date ends up decades in the past. I think it is due to a problem in how the metadata in the videos is encoded.
Steps To Reproduce
For example, video file 20120529_085506.m4v is detected as being created in 1946.
When looking at the timestamps we see the following:
However when using the QuickTime API, we can see where the wrong year comes from:
Platform
Screenshots
Additional context
There is some information on exiftool website about this: https://exiftool.org/TagNames/QuickTime.html and https://exiftool.org/ExifTool.html#QuickTimeUTC
I am not exactly sure how to solve the issue. Perhaps Memories can try with and without the
QuickTimeUTC
option to detect obviously wrong dates.The text was updated successfully, but these errors were encountered: