(data_url: str, out_path: Path)
| 19380 | request_report = bool(d.get('request_report', False)) |
| 19381 | |
| 19382 | def _dataurl_to_temp_file(data_url: str, out_path: Path): |
| 19383 | if not isinstance(data_url, str): |
| 19384 | return False |
| 19385 | if "," not in data_url: |
| 19386 | return False |
| 19387 | _, payload = data_url.split(",", 1) |
| 19388 | try: |
| 19389 | raw = base64.b64decode(payload) |
| 19390 | except Exception: |
| 19391 | return False |
| 19392 | try: |
| 19393 | out_path.parent.mkdir(parents=True, exist_ok=True) |
| 19394 | out_path.write_bytes(raw) |
| 19395 | return out_path.exists() |
| 19396 | except Exception: |
| 19397 | return False |
| 19398 | |
| 19399 | def _compute_face_hashes(file_path: Path): |
| 19400 | md5_h = hashlib.md5() |
no outgoing calls
no test coverage detected