Commits

Mikhail Korobov  committed f1dd51d

there are no non-layer tagged blocks; switch default encoding to utf8

  • Participants
  • Parent commits c4039c7

Comments (0)

Files changed (3)

File psd_tools/decoder/decoder.py

         layer_and_mask_data = new_layer_and_mask_data,
     )
 
-
     return parse_result

File psd_tools/reader/layers.py

 
 
 Layers = collections.namedtuple('Layers', 'length, layer_count, layer_records, channel_image_data')
-LayerAndMaskData = collections.namedtuple('LayerAndMaskData', 'layers global_mask_info tagged_blocks')
+LayerAndMaskData = collections.namedtuple('LayerAndMaskData', 'layers global_mask_info')
 ChannelInfo = collections.namedtuple('ChannelInfo', 'id length')
 _MaskData = collections.namedtuple('MaskData', 'top left bottom right default_color flags real_flags real_background')
 LayerBlendingRanges = collections.namedtuple('LayerBlendingRanges', 'composite_ranges channel_ranges')
     global_mask_info = _read_global_mask_info(fp)
 
     consumed_bytes = fp.tell() - start_position
-    tagged_blocks = _read_layer_tagged_blocks(fp, length - consumed_bytes)
-
-    consumed_bytes = fp.tell() - start_position
     fp.seek(length-consumed_bytes, 1)
 
-    return LayerAndMaskData(layers, global_mask_info, tagged_blocks)
+    return LayerAndMaskData(layers, global_mask_info)
 
 def _read_layers(fp, encoding):
     """
     read_bytes = 0
     while read_bytes < remaining_length:
         block = _read_additional_layer_info_block(fp)
+        read_bytes = fp.tell() - start_pos
         if block is None:
             break
         blocks.append(block)
-        read_bytes = fp.tell() - start_pos
 
     return blocks
 

File psd_tools/reader/reader.py

     'header, color_data, image_resource_blocks, layer_and_mask_data, image_data'
 )
 
-def parse(fp, encoding='latin1'):
+def parse(fp, encoding='utf8'):
 
     header = psd_tools.reader.header.read(fp)
     return ParseResult(