@@ -475,7 +475,7 @@ def _generate_markdown_content(self, markdown) -> List[str]:
475475
476476 def _generate_image_content (self , image_path : str , alt_text : str = "" , width : int = 650 , height : int = 400 ) -> str :
477477 """
478- Adds an image to the content list in a centered format with a specified width.
478+ Adds an image to the content list in an HTML format with a specified width and height .
479479
480480 Parameters
481481 ----------
@@ -484,20 +484,25 @@ def _generate_image_content(self, image_path: str, alt_text: str = "", width: in
484484 width : int, optional
485485 Width of the image in pixels (default is 650).
486486 height : int, optional
487- Height of the image in pixels (default is 500 ).
487+ Height of the image in pixels (default is 400 ).
488488 alt_text : str, optional
489489 Alternative text for the image (default is an empty string).
490490
491491 Returns
492492 -------
493493 str
494- The formatted image content.
494+ The formatted HTML image content.
495495 """
496- # Check if the image path is a URL or a local file path
497496 if is_url (image_path ):
498- return f"""{{ width= { width } px height= { height } px fig-align="center"}} \n """
497+ src = image_path
499498 else :
500- return f"""} ){{ width={ width } px height={ height } px fig-align="center"}}\n """
499+ src = os .path .abspath (image_path )
500+
501+ # Return the HTML content
502+ return f"""
503+ <div style="text-align: center;">
504+ <img src="{ src } " alt="{ alt_text } " width="{ width } " height="{ height } " />
505+ </div>\n """
501506
502507 def _show_dataframe (self , dataframe , is_report_static , static_dir : str = STATIC_FILES_DIR ) -> List [str ]:
503508 """
0 commit comments