Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008529TestLinkReportspublic2019-01-07 08:362019-01-10 16:57
ReporterArsca 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version1.9.18 (2018 Q3) 
Fixed in Version 
Summary0008529: Report PseudoWord Format - Test Plan or Test report is missing images attached to test steps.
DescriptionWhen TestPlan or TestReport is created in pseudo Word, all images attached to test steps are missing. Only red cross is shown.
Steps To Reproduce1. Start creating a test steps.
2. When test steps needs a image to clarify the test step, add it
 -> take the image to clipboard with Snipping tool (in windows)
 -> paste the image to test step "right click paste to popup"
3. When test steps finished, create TestPlan word report.
4. All test steps with images added show red cross.
TagsNo tags attached.
Database (MySQL,Postgres,etc)mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64
Browser
PHP VersionPHP 5.6.38-0+deb8u1 (cli)
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Filesjpg file icon TestCaseExport.JPG [^] (19,223 bytes) 2019-01-07 08:36


jpg file icon TestCaseImage.JPG [^] (21,727 bytes) 2019-01-07 08:37

- Relationships

-  Notes
(0028408)
fman (administrator)
2019-01-07 13:59

It's very important to understand how the images have been uploaded.
Work has been done to have images in Pesudo Word when images are added using the file upload method.
No work has been done for images that have been added using the Rich Web Editor.

can you kindly provide more details?

regards
(0028409)
Arsca (reporter)
2019-01-07 14:06

Images are Copy/pasted from clipboard, easiest and fasted way to add images.
(0028410)
fman (administrator)
2019-01-07 14:40

Dear user,
I've no doubts about what can be faster and easier, but still, you have not answered my questions:

I will try to reformulate:
are you inserting images in the Rich Web Editor?

regards
(0028411)
Arsca (reporter)
2019-01-08 07:45

Yes, in rich web editor

1. click the teststep you want to edit (I assume this is the rich web editor state, you can add bullets, bold etc.)
2. right-click to paste
3. Drag-n-drop or paste from clipboard.
2. Click ok.
(0028417)
mbar (reporter)
2019-01-10 09:01

Word macro that will decode embedded images (C:\temp is needed):

Import PseudoWord to Word application then run this macro.


---------------------------

Sub Decode64baseImage()
'
' Decode64baseImage Makro
'

Dim imgPath As String 'image temp path
imgPath = "C:\temp\img.png"

Dim text As String 'text with data

Dim oldShp As InlineShape 'shape to fix

For Each oldShp In ActiveDocument.InlineShapes
    
    text = oldShp.AlternativeText
    
    Dim pos As Long 'position of const header
    pos = InStr(1, text, "data:image/png;base64,", vbTextCompare) '22 chars
    If (pos <> Null Or pos > 0) Then
       
        pos = pos + 22 '22 for "data:...base64,"
        text = Mid(text, pos) 'get data
        'MsgBox text
            
        'decode
        text = Base64Decode(text)
        
        'create img file
        Dim imgFile As Integer
        imgFile = FreeFile
        Open imgPath For Output As #imgFile
        Print #imgFile, text
        Close #imgFile
        
        'load fixed shape from file
        Dim newShp As InlineShape
        Set newShp = ActiveDocument.InlineShapes.AddPicture(imgPath, , , oldShp.Range)
        oldShp.Delete
    
    End If
Next

End Sub


' Decodes a base-64 encoded string (BSTR type).
' 1999 - 2004 Antonin Foller, http://www.motobit.com [^]
' 1.01 - solves problem with Access And 'Compare Database' (InStr)
Function Base64Decode(ByVal base64string)
  'rfc1521
  '1999 Antonin Foller, Motobit Software, http://Motobit.cz [^]
  Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  Dim dataLength, sOut, groupBegin
  
  'remove white spaces, If any
  base64string = Replace(base64string, vbCrLf, "")
  base64string = Replace(base64string, vbTab, "")
  base64string = Replace(base64string, " ", "")
  
  'The source must consists from groups with Len of 4 chars
  dataLength = Len(base64string)
  If dataLength Mod 4 <> 0 Then
    Err.Raise 1, "Base64Decode", "Bad Base64 string."
    Exit Function
  End If

  
  ' Now decode each group:
  For groupBegin = 1 To dataLength Step 4
    Dim numDataBytes, CharCounter, thisChar, thisData, nGroup, pOut
    ' Each data group encodes up To 3 actual bytes.
    numDataBytes = 3
    nGroup = 0

    For CharCounter = 0 To 3
      ' Convert each character into 6 bits of data, And add it To
      ' an integer For temporary storage. If a character is a '=', there
      ' is one fewer data byte. (There can only be a maximum of 2 '=' In
      ' the whole string.)

      thisChar = Mid(base64string, groupBegin + CharCounter, 1)

      If thisChar = "=" Then
        numDataBytes = numDataBytes - 1
        thisData = 0
      Else
        thisData = InStr(1, Base64, thisChar, vbBinaryCompare) - 1
      End If
      If thisData = -1 Then
        Err.Raise 2, "Base64Decode", "Bad character In Base64 string."
        Exit Function
      End If

      nGroup = 64 * nGroup + thisData
    Next
    
    'Hex splits the long To 6 groups with 4 bits
    nGroup = Hex(nGroup)
    
    'Add leading zeros
    nGroup = String(6 - Len(nGroup), "0") & nGroup
    
    'Convert the 3 byte hex integer (6 chars) To 3 characters
    pOut = Chr(CByte("&H" & Mid(nGroup, 1, 2))) + _
      Chr(CByte("&H" & Mid(nGroup, 3, 2))) + _
      Chr(CByte("&H" & Mid(nGroup, 5, 2)))
    
    'add numDataBytes characters To out string
    sOut = sOut & Left(pOut, numDataBytes)
  Next

  Base64Decode = sOut
End Function
(0028423)
Arsca (reporter)
2019-01-10 11:52

Hi mbar
This macro seems to help, thanks for the tip.
(0028425)
fman (administrator)
2019-01-10 16:57

@mbar
Thanks for the workaround

- Issue History
Date Modified Username Field Change
2019-01-07 08:36 Arsca New Issue
2019-01-07 08:36 Arsca File Added: TestCaseExport.JPG
2019-01-07 08:37 Arsca File Added: TestCaseImage.JPG
2019-01-07 13:57 fman QA Team - Task Workflow Status => TBD
2019-01-07 13:57 fman Category Export/Import => Reports
2019-01-07 13:57 fman Summary Exporting Test Plan or Test report is missing images attached to test steps. => Report PseudoWord Format - Test Plan or Test report is missing images attached to test steps.
2019-01-07 13:57 fman Description Updated View Revisions
2019-01-07 13:57 fman Steps to Reproduce Updated View Revisions
2019-01-07 13:59 fman Note Added: 0028408
2019-01-07 13:59 fman Assigned To => fman
2019-01-07 13:59 fman Status new => feedback
2019-01-07 14:06 Arsca Note Added: 0028409
2019-01-07 14:06 Arsca Status feedback => assigned
2019-01-07 14:40 fman Note Added: 0028410
2019-01-07 14:40 fman Assigned To fman =>
2019-01-07 14:40 fman Status assigned => feedback
2019-01-08 07:45 Arsca Note Added: 0028411
2019-01-08 07:45 Arsca Status feedback => new
2019-01-10 09:01 mbar Note Added: 0028417
2019-01-10 11:52 Arsca Note Added: 0028423
2019-01-10 16:57 fman Note Added: 0028425



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker