(dimension)
| 544 | def score_image_for_usefulness(img, base_url, index, images_count): |
| 545 | # Function to parse image height/width value and units |
| 546 | def parse_dimension(dimension): |
| 547 | if dimension: |
| 548 | match = re.match(r"(\d+)(\D*)", dimension) |
| 549 | if match: |
| 550 | number = int(match.group(1)) |
| 551 | unit = match.group(2) or 'px' # Default unit is 'px' if not specified |
| 552 | return number, unit |
| 553 | return None, None |
| 554 | |
| 555 | # Fetch image file metadata to extract size and extension |
| 556 | def fetch_image_file_size(img, base_url): |
no outgoing calls
no test coverage detected
searching dependent graphs…