Skip to content

EpsFilePlugin Speed improvements. #886

Merged
hugovk merged 9 commits into
python-pillow:masterfrom
wiredfool:epsfile-rebase
Sep 13, 2014
Merged

EpsFilePlugin Speed improvements. #886
hugovk merged 9 commits into
python-pillow:masterfrom
wiredfool:epsfile-rebase

Conversation

@wiredfool
Copy link
Copy Markdown
Member

Fix for #838.

@karstenw -- Sorry on the delay for this. This should be what we've discussed in #838, stripped down to remove excess code in a few places.

  • Universal line ending wrappers are called for files
  • There's a shim for doing line endings for BytesIO/StringIO.
  • The initial read is done on the bare fp, so no line ending translation is done.
  • If it's a file, ghostscript should use the file without copying, if not, it writes to a temp file first.

@coveralls
Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 918c77e on wiredfool:epsfile-rebase into * on python-pillow:master*.

@wiredfool
Copy link
Copy Markdown
Member Author

2 notes. I've disabled some tests that weren't testing our code. They do pass where expected, and fail in a portion that's an edge case in the spec.

Those tests indicate that the way that we're treating the line endings isn't 100% to spec if we use the builtin python universal line endings file wrappers. We can do it correctly, but slower, by only using our internal python file pointer wrapper PSFile. This should only be an issue if an eps file mixes line endings in one file or uses the really messed up \n\r combination.

@coveralls
Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling ce0fcef on wiredfool:epsfile-rebase into * on python-pillow:master*.

hugovk added a commit that referenced this pull request Sep 13, 2014
EpsFilePlugin Speed improvements.
@hugovk hugovk merged commit af8bf3f into python-pillow:master Sep 13, 2014
@karstenw
Copy link
Copy Markdown

Since we're reading only comments and an empty line simply does not count as a comment, as would be the case with \n\r, I'm still in favor of using universal+'ignore empty lines'.

Let's not forget that GS does the work even though source comments indicate otherwise.

All we need to do is read as much meta data as we can get from the ps/eps.

@wiredfool wiredfool deleted the epsfile-rebase branch October 2, 2017 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants