mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
Meta/jbig2_to_pdf.py: Write correct page contents stream length
The previoulsy hardcoded `25` worked only if the image had width and height with three digits each (e.g. 399x400).
This commit is contained in:
parent
2872c37993
commit
05844141bf
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/05844141bf Pull-request: https://github.com/SerenityOS/serenity/pull/23803
1 changed files with 9 additions and 4 deletions
|
@ -115,6 +115,10 @@ def main():
|
||||||
|
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
operators = dedent(b'''\
|
||||||
|
%d 0 0 %d 0 0 cm
|
||||||
|
/Im Do''' % (width, height))
|
||||||
|
|
||||||
objs = [dedent(b'''\
|
objs = [dedent(b'''\
|
||||||
1 0 obj
|
1 0 obj
|
||||||
<<
|
<<
|
||||||
|
@ -152,13 +156,14 @@ def main():
|
||||||
|
|
||||||
dedent(b'''\
|
dedent(b'''\
|
||||||
4 0 obj
|
4 0 obj
|
||||||
<</Length 25>>
|
<</Length %d>>
|
||||||
stream
|
stream
|
||||||
%d 0 0 %d 0 0 cm
|
''' % len(operators)) +
|
||||||
/Im Do
|
operators +
|
||||||
|
dedent(b'''
|
||||||
endstream
|
endstream
|
||||||
endobj
|
endobj
|
||||||
''' % (width, height)),
|
'''),
|
||||||
|
|
||||||
dedent(b'''\
|
dedent(b'''\
|
||||||
5 0 obj
|
5 0 obj
|
||||||
|
|
Loading…
Add table
Reference in a new issue