更新 HEICFile 和相关类以支持 'iref' 功能,添加获取网格布局的方法,增强文件分析功能

This commit is contained in:
Nymiro
2025-10-20 12:55:31 +13:00
parent 7715acd18b
commit 7130a1b85c
8 changed files with 133 additions and 63 deletions
+12 -2
View File
@@ -14,11 +14,21 @@ def analyze_file(filename: str):
if primary_id:
print(f"The primary item ID is: {primary_id}")
# --- Use our new feature! ---
# Get the primary image dimensions
size = heic_file.get_image_size(primary_id)
if size:
print(f"Primary image dimensions (WxH): {size[0]} x {size[1]}")
# --- Use our new feature! ---
grid_layout = heic_file.get_grid_layout()
if grid_layout:
print(f"Primary image is a grid composed of these item IDs: {grid_layout}")
# Optional: Get size of the first tile to see the difference
first_tile_id = grid_layout[0]
tile_size = heic_file.get_image_size(first_tile_id)
if tile_size:
print(f" - Size of the first tile (ID {first_tile_id}): {tile_size[0]} x {tile_size[1]}")
print("\n" + "="*40 + "\n")
def main():