MantisBT - ParaView
View Issue Details
0011989ParaViewBugpublic2011-03-19 04:482016-08-12 09:58
Florian Kummer 
Cory Quammen 
normalminoralways
closedmoved 
x86Windows7
3.8.1 
 
0011989: Base64 encoding of VTK output
Maybe the Base64 - encoding/decoding is not standart-conform?

As far as I understood, the decoded stream is in the format
{int n, float d[0], ... , float d[n-1]}

I exported a very simple example with Paraview;
I'm able to decode the floats, but the leading integer is just wrong;
I'm pretty sure that my decoder works correctly, because it decodes some example from wikipedia (http://de.wikipedia.org/wiki/Base64#Beispiel [^]) correctly,
as well as it decodes the floats correctly;
Load attached file test-ascii.vtr in Paraview, and save data as Rectilinear VTK, binary, no compression;

Open the new file, copy and paste some of the strings to the program VTR_Demo_.c (i've allready done that)

Compile the attached program VTR_Demo_.c;
In line 138, 141, 144 you'll find three examples of Base64-Encoded data, allways two of them commented out;
One is a reference (from http://de.wikipedia.org/wiki/Base64#Beispiel [^]), and the other two's came from the Paravie VTR export;

Run the Program, on the output you will see the leading integer of the data stream, as well as the next three floats;
The integer is wrong;
No tags attached.
? test-ascii.vtr (963) 2011-03-19 04:48
https://www.vtk.org/Bug/file/8761/test-ascii.vtr
? test-binary.vtr (1,053) 2011-03-19 04:49
https://www.vtk.org/Bug/file/8762/test-binary.vtr
c VTR_Demo_.c (6,739) 2011-03-19 04:50
https://www.vtk.org/Bug/file/8763/VTR_Demo_.c
Issue History
2011-03-19 04:48Florian KummerNew Issue
2011-03-19 04:48Florian KummerFile Added: test-ascii.vtr
2011-03-19 04:49Florian KummerFile Added: test-binary.vtr
2011-03-19 04:50Florian KummerFile Added: VTR_Demo_.c
2011-03-20 15:13Robert MaynardNote Added: 0025834
2011-03-20 16:07Robert MaynardNote Edited: 0025834bug_revision_view_page.php?bugnote_id=25834#r257
2016-07-25 12:59Cory QuammenNote Added: 0036558
2016-07-25 12:59Cory QuammenStatusbacklog => closed
2016-07-25 12:59Cory QuammenAssigned To => Cory Quammen
2016-07-25 12:59Cory QuammenResolutionopen => no change required
2016-07-25 22:25Cory QuammenStatusclosed => backlog
2016-07-25 22:25Cory QuammenResolutionno change required => reopened
2016-07-25 22:28Cory QuammenNote Added: 0036597
2016-07-25 22:28Cory QuammenStatusbacklog => customer review
2016-07-25 22:28Cory QuammenResolutionreopened => fixed
2016-08-12 09:58Kitware RobotNote Added: 0037940
2016-08-12 09:58Kitware RobotStatuscustomer review => closed
2016-08-12 09:58Kitware RobotResolutionfixed => moved

Notes
(0025834)
Robert Maynard   
2011-03-20 15:13   
(edited on: 2011-03-20 16:07)
You should read how the binary format is constructed on this wiki page:
http://www.vtk.org/Wiki/VTK_XML_Formats [^]

The integer doesn't represent the length, the length is derived from the extents and the spacing.

EDIT:
Off the top of my head I don't know what the first integer represents when use base64 encoding.

(0036558)
Cory Quammen   
2016-07-25 12:59   
There does not appear to be a problem writing with base64 encoding and then reading the file within ParaView itself.
(0036597)
Cory Quammen   
2016-07-25 22:28   
To test:

Start ParaView, local server
Open the attached file test-ascii.vtr
Save the data set with binary encoding to another file name, choose Encode Appended Data
Reopen the data set
All works fine

I don't know what the first integer is, but as far as ParaView is concerned the writer and reader with Base64 encoding works fine.
(0037940)
Kitware Robot   
2016-08-12 09:58   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.