I want to use the JPGAndDataView but giving the imagepath to JPGAndDataResult doesn’t work. How should I retrieve the image from the path to make this work?
@JPGAndDataView("Gekozen profiel", duration_guess=1)
def get_chosen_profile(self, params: dict, entity_id: int, **kwargs) -> JPGAndDataResult:
project_params = self.get_project_params(entity_id)
selected_section_index = params['design']['visualisation']['visualize_section_options']
selected_variant = get_variant_with_inputs(params, selected_section_index)=
image_path = selected_variant.get_path_to_image()
data = DataGroup(
DataItem('Data item 1', 123)
)
return JPGAndDataResult(html=image_path, data=data)