feat(visualizer): Add VisualizableImage component. Closes #3023 #3094
+505
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

This pull request adds support for visualizing images in the application, both on the backend and frontend. It introduces a new
VisualizableImagecomponent that can display images from a URL or base64 data, with options for titles, descriptions, sizing, and expand-to-modal functionality. The change is thoroughly integrated into the backend Python classes, frontend React components, validation logic, and includes comprehensive tests for both backend and frontend implementations.Image Visualization Feature
VisualizableImageclass toapi_app/visualizers_manager/classes.pyfor representing images with support for URL or base64 sources, titles, descriptions, sizing, alignment, and expand/collapse behavior. Raises aValueErrorif neither source is provided.IMAGEtoVisualizerComponentType, implemented theImageVisualizerReact component with modal expand, loading, error, and disabled states, and updated the main visualizer to render images. [1] [2] [3] [4]validators.jsto parse and validate image-specific fields (URL, base64, title, description, sizing, expand option).Testing
VisualizableImagecovering serialization, required fields, default values, and disabled state. [1] [2]ImageVisualizercovering rendering from URL and base64, error and loading states, modal expand functionality, and disabled state.These changes ensure that images can now be reliably displayed and interacted with in the visualizer, with robust validation and test coverage.
Description
This PR implements a new
VisualizableImagecomponent that allows embedding screenshots or other images in the IntelOwl Visualizer results pages. Closes #3023Changes
Backend (
api_app/visualizers_manager/classes.py):VisualizableImageclass extendingVisualizableObjecturl(external URL) andbase64(encoded data)title,description,max_width,max_height,allow_expandFrontend (
frontend/src/components/common/visualizer/elements/image.jsx):ImageVisualizerReact componentIntegration:
IMAGEtype toVisualizerComponentTypeenumTests:
tests/api_app/visualizers_manager/test_classes.pyfrontend/tests/components/common/visualizer/elements/image.test.jsxExample Usage (Python Visualizer)
Raw JSON Output
{ "type": "image", "url": "https://example.com/screenshot.png", "base64": "", "title": "Website Screenshot", "description": "Captured by URLscan", "max_width": 500, "max_height": 400, "allow_expand": true, "size": "auto", "alignment": "center", "disable": false }Type of change
Checklist
developurlattribute. (Component does not interact with external services directly)_monkeypatch(). (No external API calls)Black,Flake,Isort) gave 0 errorsScreenshots