diff --git a/lib/galaxy/tool_util/verify/__init__.py b/lib/galaxy/tool_util/verify/__init__.py index cac554dd0b7..66dda2ceda4 100644 --- a/lib/galaxy/tool_util/verify/__init__.py +++ b/lib/galaxy/tool_util/verify/__init__.py @@ -595,6 +595,12 @@ def files_image_diff(file1: str, file2: str, attributes: Optional[Dict[str, Any] if arr1.shape != arr2.shape: raise AssertionError(f"Image dimensions did not match ({arr1.shape}, {arr2.shape}).") + # Handle `bool` images by converting them to `uint8` + if numpy.issubdtype(arr1.dtype, bool): + arr1 = arr1.astype(numpy.uint8) + if numpy.issubdtype(arr2.dtype, bool): + arr2 = arr2.astype(numpy.uint8) + distance = get_image_metric(attributes)(arr1, arr2) distance_eps = attributes.get("eps", DEFAULT_EPS) if distance > distance_eps: diff --git a/test/functional/tools/image_diff.xml b/test/functional/tools/image_diff.xml index addb4ef24b4..d6d9f9b1ffb 100644 --- a/test/functional/tools/image_diff.xml +++ b/test/functional/tools/image_diff.xml @@ -27,6 +27,11 @@ + + + + +