Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008576TestLinkReportspublic2019-02-21 15:012019-02-22 15:06
ReporterPepaS 
Assigned To 
PrioritylowSeverityfeature requestReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version1.9.19 (2019 Q1) 
Fixed in Version 
Summary0008576: test report - attachment image dimension
Descriptionif the attachment image is too large, it breaks the report structure both for HTML and pseudoMSword

would be great to add a function to reduce dimension of the image to match the paper size
Additional Informationadded hotfix for me (starting line 1264), but there might be better solution - I am not experienced with php

if($fitem['is_image']) {
  $code .= "
  • {$safeFileName}
  • ";

      $pathname = $st->repoDir . $fitem['file_path'];
      list($iWidth, $iHeight, $iT, $iA) = getimagesize($pathname);
      $imgRatio = $iWidth/$iHeight;
      if($iWidth > 900 or $iHeight > 700) {
        if($iWidth > $iHeight) {
          $imgDiff = round($iWidth / 600);
        } else {
          $imgDiff = round($iHeight / 450);
        }
        $iWidth = $iWidth/$imgDiff;
        $iHeight = $iHeight/$imgDiff;
      }
      $iDim = ' width=' . $iWidth . ' height=' . $iHeight;
      $code .= '
  • <img ' . $iDim .
               ' src="' . $env->base_href . $cmout . '">';
    } else {
  • TagsNo tags attached.
    Database (MySQL,Postgres,etc)MySQL
    Browser
    PHP Versionphp 7.3.1
    TestCaseID
    QA Team - Task Workflow Status
    Attached Files

    - Relationships

    -  Notes
    (0028543)
    fman (administrator)
    2019-02-21 17:26

    well, may be is better that people resize the image.
    (0028550)
    PepaS (reporter)
    2019-02-22 06:32

    in that case It may be useful to put a warning about dimension into $TLS_max_size_file_upload

    ...as long as we are humans, I will stick to the function anyway
    (0028552)
    fman (administrator)
    2019-02-22 15:06

    $TLS_max_size_file_upload blocks the upload but may be what is ok for a txt file is not good for an image

    Being human and being lazy or fuzzy are two different things

    - Issue History
    Date Modified Username Field Change
    2019-02-21 15:01 PepaS New Issue
    2019-02-21 17:26 fman Note Added: 0028543
    2019-02-22 06:32 PepaS Note Added: 0028550
    2019-02-22 15:06 fman Note Added: 0028552



    Copyright © 2000 - 2019 MantisBT Team
    Powered by Mantis Bugtracker