MantisBT - TestLink
View Issue Details
0008529TestLinkReportspublic2019-01-07 08:362019-01-10 16:57
Arsca 
 
normalmajoralways
newopen 
1.9.18 (2018 Q3) 
 
mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64
PHP 5.6.38-0+deb8u1 (cli)
TBD
0008529: Report PseudoWord Format - Test Plan or Test report is missing images attached to test steps.
When TestPlan or TestReport is created in pseudo Word, all images attached to test steps are missing. Only red cross is shown.
1. 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.
No tags attached.
jpg TestCaseExport.JPG (19,223) 2019-01-07 08:36
http://mantis.testlink.org/file_download.php?file_id=5075&type=bug
jpg

jpg TestCaseImage.JPG (21,727) 2019-01-07 08:37
http://mantis.testlink.org/file_download.php?file_id=5076&type=bug
jpg
Issue History
2019-01-07 08:36ArscaNew Issue
2019-01-07 08:36ArscaFile Added: TestCaseExport.JPG
2019-01-07 08:37ArscaFile Added: TestCaseImage.JPG
2019-01-07 13:57fmanQA Team - Task Workflow Status => TBD
2019-01-07 13:57fmanCategoryExport/Import => Reports
2019-01-07 13:57fmanSummaryExporting 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:57fmanDescription Updatedbug_revision_view_page.php?rev_id=5709#r5709
2019-01-07 13:57fmanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=5711#r5711
2019-01-07 13:59fmanNote Added: 0028408
2019-01-07 13:59fmanAssigned To => fman
2019-01-07 13:59fmanStatusnew => feedback
2019-01-07 14:06ArscaNote Added: 0028409
2019-01-07 14:06ArscaStatusfeedback => assigned
2019-01-07 14:40fmanNote Added: 0028410
2019-01-07 14:40fmanAssigned Tofman =>
2019-01-07 14:40fmanStatusassigned => feedback
2019-01-08 07:45ArscaNote Added: 0028411
2019-01-08 07:45ArscaStatusfeedback => new
2019-01-10 09:01mbarNote Added: 0028417
2019-01-10 11:52ArscaNote Added: 0028423
2019-01-10 16:57fmanNote Added: 0028425

Notes
(0028408)
fman   
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   
2019-01-07 14:06   
Images are Copy/pasted from clipboard, easiest and fasted way to add images.
(0028410)
fman   
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   
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   
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   
2019-01-10 11:52   
Hi mbar
This macro seems to help, thanks for the tip.
(0028425)
fman   
2019-01-10 16:57   
@mbar
Thanks for the workaround