Fixed issue with video dataset sizing
This commit is contained in:
@@ -62,7 +62,7 @@ class FileItemDTO(
|
|||||||
use_db_entry = False
|
use_db_entry = False
|
||||||
if file_key in size_database:
|
if file_key in size_database:
|
||||||
db_entry = size_database[file_key]
|
db_entry = size_database[file_key]
|
||||||
if db_entry is not None and db_entry[2] == file_signature:
|
if db_entry is not None and len(db_entry) >= 3 and db_entry[2] == file_signature:
|
||||||
use_db_entry = True
|
use_db_entry = True
|
||||||
|
|
||||||
if use_db_entry:
|
if use_db_entry:
|
||||||
@@ -81,7 +81,7 @@ class FileItemDTO(
|
|||||||
|
|
||||||
# Release the video capture object immediately
|
# Release the video capture object immediately
|
||||||
video.release()
|
video.release()
|
||||||
size_database[file_key] = (width, height)
|
size_database[file_key] = (width, height, file_signature)
|
||||||
else:
|
else:
|
||||||
# original method is significantly faster, but some images are read sideways. Not sure why. Do slow method for now.
|
# original method is significantly faster, but some images are read sideways. Not sure why. Do slow method for now.
|
||||||
# process width and height
|
# process width and height
|
||||||
|
|||||||
Reference in New Issue
Block a user