ysn-rfd/text-dataset-tiny-code-script-py-format
USED of tahamajs/medicine_ds_persian for .parquet file USED of Alijafarixcs2/persian-it-llama2-2k for .parquet file USED of Abirate/english_quotes for .jsonl file NEW FILES (05/12/2025) NEW FILES (12/26/2025) NEW FILES (02/15/2026)
31.7k
1import exiftool
2import os
3import json
4
5def extract_all_metadata(image_path):
6 if not os.path.exists(image_path):
7 print("❌ فایل وجود ندارد.")
8 return
9
10 print(f"\n📂 فایل: {os.path.basename(image_path)}")
11 with exiftool.ExifTool() as et:
12 metadata = et.get_metadata(image_path)
13
14 if not metadata:
15 print("⛔️ هیچ متادیتایی پیدا نشد.")
16 return
17
18 print("\n📑 تمام metadata موجود:")
19 for key, value in metadata.items():
20 print(f"{key}: {value}")
21
22 # ذخیره در فایل JSON (اختیاری)
23 json_output = image_path + ".metadata.json"
24 with open(json_output, "w", encoding="utf-8") as f:
25 json.dump(metadata, f, indent=4, ensure_ascii=False)
26 print(f"\n✅ متادیتا در فایل ذخیره شد: {json_output}")
27
28# مسیر عکس را وارد کن (فرمت PNG, JPG, WebP و ...)
29image_file = "0002.png"
30extract_all_metadata(image_file)
31 