chore: initial Gitea migration with .gitignore
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
temp_libs/
|
||||||
|
test_output/
|
||||||
|
*.jpg
|
||||||
|
*.txt
|
||||||
|
dist/
|
||||||
|
*.egg-info/
|
||||||
+15
-16
@@ -607,24 +607,23 @@ class HEICFile:
|
|||||||
print("Info: No 'thmb' references found in 'iref' box.")
|
print("Info: No 'thmb' references found in 'iref' box.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
target_id = primary_id
|
# Search all 'thmb' references to find which item points TO our primary_id.
|
||||||
if primary_id not in self._iref_box.references['thmb']:
|
thumbnail_id = None
|
||||||
shifted_primary_id = primary_id << 16
|
for from_id, to_ids in self._iref_box.references['thmb'].items():
|
||||||
if shifted_primary_id not in self._iref_box.references['thmb']:
|
if primary_id in to_ids:
|
||||||
print(f"Info: Primary item ID {primary_id} (or shifted) has no 'thmb' reference.")
|
thumbnail_id = from_id
|
||||||
|
break
|
||||||
|
|
||||||
|
# Also check shifted variant of primary_id
|
||||||
|
if (primary_id << 16) in to_ids:
|
||||||
|
thumbnail_id = from_id
|
||||||
|
break
|
||||||
|
|
||||||
|
if thumbnail_id is None:
|
||||||
|
print(f"Info: No 'thmb' reference points to primary item ID {primary_id}.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
print("Info: Using shifted primary ID to find thumbnail.")
|
print(f"Found thumbnail reference: Thumbnail ID {thumbnail_id} -> Primary ID {primary_id}")
|
||||||
target_id = shifted_primary_id
|
|
||||||
|
|
||||||
|
|
||||||
thumbnail_ids = self._iref_box.references['thmb'][target_id]
|
|
||||||
if not thumbnail_ids:
|
|
||||||
print(f"Info: Primary item ID {target_id} has 'thmb' reference, but no target IDs.")
|
|
||||||
return None
|
|
||||||
|
|
||||||
thumbnail_id = thumbnail_ids[0]
|
|
||||||
print(f"Found thumbnail reference: Primary ID {target_id} -> Thumbnail ID {thumbnail_id}")
|
|
||||||
|
|
||||||
thumbnail_data = self.get_item_data(thumbnail_id)
|
thumbnail_data = self.get_item_data(thumbnail_id)
|
||||||
|
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ class ItemReferenceBox(FullBox):
|
|||||||
ref_box_type = ref_box.type
|
ref_box_type = ref_box.type
|
||||||
self.references[ref_box_type] = {}
|
self.references[ref_box_type] = {}
|
||||||
|
|
||||||
stream = ref_box.raw_data[4:]
|
stream = ref_box.raw_data
|
||||||
pos = 0
|
pos = 0
|
||||||
|
|
||||||
if pos + item_id_size > len(stream):
|
if pos + item_id_size > len(stream):
|
||||||
|
|||||||
Reference in New Issue
Block a user