Skip to content

Commit

Permalink
Allow longer lines
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Jul 18, 2024
1 parent d81385a commit e404d82
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pydyf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,7 @@ def write(self, output, version=b'1.7', identifier=False, compress=False):
dict_index += 1
else:
xref.append((
bool(object_.number), object_.offset,
object_.generation))
bool(object_.number), object_.offset, object_.generation))
xref.append((1, self.current_position, 0))

field2_size = ceil(log(self.current_position + 1, 256))
Expand All @@ -600,13 +599,11 @@ def write(self, output, version=b'1.7', identifier=False, compress=False):
'Info': self.info.reference,
}
if identifier:
data = b''.join(
obj.data for obj in self.objects if obj.free != 'f')
data = b''.join(obj.data for obj in self.objects if obj.free != 'f')
data_hash = md5(data).hexdigest().encode()
if identifier is True:
identifier = data_hash
extra['ID'] = Array((
String(identifier).data, String(data_hash).data))
extra['ID'] = Array((String(identifier).data, String(data_hash).data))
dict_stream = Stream([xref_stream], extra, compress)
self.xref_position = dict_stream.offset = self.current_position
self.add_object(dict_stream)
Expand Down

0 comments on commit e404d82

Please sign in to comment.