We have Mantis confgured that attached screenshots are automatically displayed in the bug page.
But out users tend to attach large screenshots, I would like mantis resize them automatically if they're above a specified resolution (I think this can be done with width/height attributes of the img tag).
Someone knows if this is already included in Mantis or an easy way to do it?
Regards,
Sebastian
Resize Screenshots
Moderators: Developer, Contributor
This can easily be done by modifying the file_list_attachments function of file_api.php and adding a "width" attribute to the <img> tag.
It would be nice if you could add something like this to the code and add the width as a parameter to the config.
Here is a patch for Mantis 1.0.5 that scales the displayed image to 800 pixel width:
It would be nice if you could add something like this to the code and add the width as a parameter to the config.
Here is a patch for Mantis 1.0.5 that scales the displayed image to 800 pixel width:
Code: Select all
*** file_api.php.bak Tue Mar 6 17:31:32 2007
--- file_api.php Tue Mar 6 17:31:32 2007
***************
*** 188,194 ****
( $v_filesize != 0 ) &&
( in_array( strtolower( file_get_extension( $t_file_display_name ) ), array( 'png', 'jpg', 'jpeg', 'gif', 'bmp' ), true ) ) ) {
! PRINT "<br /><img src=\"file_download.php?file_id=$v_id&type=bug\" />";
$image_previewed = true;
}
--- 188,194 ----
( $v_filesize != 0 ) &&
( in_array( strtolower( file_get_extension( $t_file_display_name ) ), array( 'png', 'jpg', 'jpeg', 'gif', 'bmp' ), true ) ) ) {
! PRINT "<br /><img width=\"800\" src=\"file_download.php?file_id=$v_id&type=bug\" />";
$image_previewed = true;
}