Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008576TestLinkReportspublic2019-02-21 15:012020-04-21 17:58
ReporterPepaS 
Assigned Tofman 
PrioritylowSeverityfeature requestReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.9.19 (2019 Q1) 
Fixed in Version1.9.20_fixed 
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 StatusTBD
    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
    (0029607)
    hguilherme66 (reporter)
    2020-04-21 10:44

    This feature request is important for my use cases. I have to add a smartphone screen capture for many steps, they are too big. Having to do image resizing during each step execution is not an option, because I am already using too much time to capture image on phone, transfer via USB to PC, then attach to step.
    (0029609)
    fman (administrator)
    2020-04-21 12:24

    You can try with the proposed code
    (0029610)
    hguilherme66 (reporter)
    2020-04-21 13:09

    I did and works fine. But I'd like to have in official release.
    (0029611)
    fman (administrator)
    2020-04-21 16:06

    @hguilherme66
    I'm going to make the changes .
    Do you think you company can support TestLink development with a donation via paypal? or an amazon gift card?

    regards
    (0029613)
    fman (administrator)
    2020-04-21 17:57

    https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/9600fcb0df9bdfd5d85d466efeca3edfb4a1714a [^]

    - 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
    2020-04-21 10:44 hguilherme66 Note Added: 0029607
    2020-04-21 12:24 fman Note Added: 0029609
    2020-04-21 13:09 hguilherme66 Note Added: 0029610
    2020-04-21 16:06 fman Note Added: 0029611
    2020-04-21 17:57 fman Note Added: 0029613
    2020-04-21 17:58 fman QA Team - Task Workflow Status => TBD
    2020-04-21 17:58 fman Fixed in Version => 1.9.20_fixed
    2020-04-21 17:58 fman Status new => resolved
    2020-04-21 17:58 fman Resolution open => fixed
    2020-04-21 17:58 fman Assigned To => fman



    Copyright © 2000 - 2020 MantisBT Team
    Powered by Mantis Bugtracker