Skip to content

zlib compressor error #45

@henry2004y

Description

@henry2004y

Hi again,

I have a vti file generated by ParaView 5.11. If I choose no compressor when saving data from ParaView, then the generated file and the corresponding point data can be read by ReadVTK.jl; however, if I choose the zlib compressor, then I get the error:

julia> vtk = VTKFile("test2.vti")
VTKFile("test2.vti", <XMLDocument>, "ImageData", "2.2.0", "LittleEndian", "vtkZLibDataCompressor", <appended_data>, 8000, 6859)

julia> point_data = get_point_data(vtk)
VTKData()

julia> B = get_data(point_data["B"])
ERROR: zlib error: incorrect header check (code: -3)
Stacktrace:
 [1] unsafe_transcode!(output::TranscodingStreams.Buffer, codec::CodecZlib.ZlibDecompressor, input::TranscodingStreams.Buffer)
   @ TranscodingStreams C:\Users\hyzho\.julia\packages\TranscodingStreams\2McN2\src\transcode.jl:183
 [2] transcode!
   @ C:\Users\hyzho\.julia\packages\TranscodingStreams\2McN2\src\transcode.jl:127 [inlined]
 [3] transcode(codec::CodecZlib.ZlibDecompressor, input::TranscodingStreams.Buffer, output::Nothing)
   @ TranscodingStreams C:\Users\hyzho\.julia\packages\TranscodingStreams\2McN2\src\transcode.jl:109
 [4] transcode
   @ C:\Users\hyzho\.julia\packages\TranscodingStreams\2McN2\src\transcode.jl:108 [inlined]
 [5] transcode
   @ C:\Users\hyzho\.julia\packages\TranscodingStreams\2McN2\src\transcode.jl:189 [inlined]
 [6] transcode(#unused#::Type{CodecZlib.ZlibDecompressor}, args::Vector{UInt8})
   @ TranscodingStreams C:\Users\hyzho\.julia\packages\TranscodingStreams\2McN2\src\transcode.jl:37
 [7] get_data(data_array::VTKDataArray{Float64, 3, ReadVTK.FormatAppended})
   @ ReadVTK D:\Computer\ReadVTK.jl\src\ReadVTK.jl:740
 [8] top-level scope
   @ REPL[5]:1

This generated compressed vti file can be read by ParaView. Does it indicate that there are different types of compression zlib format?

A link to the test file is here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions