mistocr 0.2.7__tar.gz → 0.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mistocr
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Batch OCR for PDFs with heading restoration and visual content integration
5
5
  Home-page: https://github.com/franckalbinet/mistocr
6
6
  Author: Solveit
@@ -0,0 +1 @@
1
+ __version__ = "0.2.8"
@@ -220,6 +220,12 @@ async def add_img_descs(
220
220
  src_path,dst_path = Path(src),Path(dst) if dst else Path(src)
221
221
  if dst_path != src_path: dst_path.mkdir(parents=True, exist_ok=True)
222
222
  src_imgs = src_path/img_folder
223
+
224
+ # Check if image folder exists
225
+ if not src_imgs.exists():
226
+ if progress: print(f"No images to describe in the document (no '{img_folder}' folder found)")
227
+ return
228
+
223
229
  if src_imgs.exists() and dst_path != src_path: shutil.copytree(src_imgs, dst_path/img_folder, dirs_exist_ok=True)
224
230
  desc_file = src_path/'img_descriptions.json'
225
231
  if desc_file.exists() and not force:
@@ -236,3 +242,4 @@ async def add_img_descs(
236
242
  enriched = [add_descs_to_pg(pg, descs) for pg in pgs]
237
243
  for i,pg in enumerate(enriched, 1): (dst_path/f'page_{i}.md').write_text(pg)
238
244
  if progress: print(f"Done! Enriched pages saved to {dst_path}")
245
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mistocr
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Batch OCR for PDFs with heading restoration and visual content integration
5
5
  Home-page: https://github.com/franckalbinet/mistocr
6
6
  Author: Solveit
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = mistocr
3
3
  lib_name = mistocr
4
- version = 0.2.7
4
+ version = 0.2.8
5
5
  min_python = 3.9
6
6
  license = apache2
7
7
  black_formatting = False
@@ -1 +0,0 @@
1
- __version__ = "0.2.7"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes