--- /dev/null
+"""
+This script for comparing two sets of DesignQR code images generated from different sources.
+
+Please set
+#define SAVE_QR_IMG
+#define LARGE_COMB_SET
+in test/testsuites/barcode/test_designqr.cpp
+before running the test case. Then, run the test case and save the generated images in /tmp directory.
+"""
+import os
+
+def compare_images(org_dir, tmp_dir):
+ org_files = [f for f in os.listdir(org_dir) if f.endswith('.png')]
+
+ for file_name in org_files:
+ org_file_path = os.path.join(org_dir, file_name)
+ tmp_file_path = os.path.join(tmp_dir, file_name)
+
+ if os.path.exists(org_file_path) and os.path.exists(tmp_file_path):
+ with open(org_file_path, 'rb') as f1, open(tmp_file_path, 'rb') as f2:
+ if f1.read() != f2.read():
+ print(f"{file_name}: different image.")
+
+# User needs to set the directories where original and temporary images are stored.
+org_directory = '/orig'
+tmp_directory = '/tmp'
+
+compare_images(org_directory, tmp_directory)
+print('done')