Skip to content

Commit

Permalink
Python2/3 compatibility on merging pages with eps img into single page
Browse files Browse the repository at this point in the history
  • Loading branch information
im2703 authored and Igor Mihaljevic committed Dec 14, 2015
1 parent 7456f0a commit b06ac57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
*.swp
.DS_Store
build
.idea/*

10 changes: 5 additions & 5 deletions PyPDF2/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2724,14 +2724,14 @@ def _readInlineImage(self, stream):
def _getData(self):
newdata = BytesIO()
for operands, operator in self.operations:
if operator == "INLINE IMAGE":
newdata.write("BI")
dicttext = StringIO()
if operator == b_("INLINE IMAGE"):
newdata.write(b_("BI"))
dicttext = BytesIO()
operands["settings"].writeToStream(dicttext, None)
newdata.write(dicttext.getvalue()[2:-2])
newdata.write("ID ")
newdata.write(b_("ID "))
newdata.write(operands["data"])
newdata.write("EI")
newdata.write(b_("EI"))
else:
for op in operands:
op.writeToStream(newdata, None)
Expand Down

0 comments on commit b06ac57

Please sign in to comment.