Get first valid image from directory
(self, image_dir)
| 50 | logger.info(f' Output: {self.output_dir}') |
| 51 | |
| 52 | def get_test_image(self, image_dir): |
| 53 | """Get first valid image from directory""" |
| 54 | if not image_dir.exists(): |
| 55 | logger.warning(f'Directory not found: {image_dir}') |
| 56 | return None |
| 57 | |
| 58 | for ext in ['.jpg', '.jpeg', '.png', '.bmp']: |
| 59 | images = list(image_dir.glob(f'*{ext}')) |
| 60 | if images: |
| 61 | return str(images[0]) |
| 62 | |
| 63 | logger.warning(f'No images found in: {image_dir}') |
| 64 | return None |
| 65 | |
| 66 | def test_python_api(self): |
| 67 | """Test OpenOCR using Python API""" |
no outgoing calls
no test coverage detected