'cmap' - correct stride interpreting CMP,MTYP,PCOL
Fix for number of components different from 3
This commit is contained in:
parent
0c32b403b0
commit
844540df92
1 changed files with 3 additions and 3 deletions
|
|
@ -879,9 +879,9 @@ class ComponentMappingBox(Jp2kBox):
|
||||||
read_buffer = fptr.read(num_bytes)
|
read_buffer = fptr.read(num_bytes)
|
||||||
data = struct.unpack('>' + 'HBB' * num_components, read_buffer)
|
data = struct.unpack('>' + 'HBB' * num_components, read_buffer)
|
||||||
|
|
||||||
component_index = data[0:num_bytes:num_components]
|
component_index = data[0:num_bytes:3]
|
||||||
mapping_type = data[1:num_bytes:num_components]
|
mapping_type = data[1:num_bytes:3]
|
||||||
palette_index = data[2:num_bytes:num_components]
|
palette_index = data[2:num_bytes:3]
|
||||||
|
|
||||||
box = ComponentMappingBox(component_index, mapping_type, palette_index,
|
box = ComponentMappingBox(component_index, mapping_type, palette_index,
|
||||||
length=length, offset=offset)
|
length=length, offset=offset)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue