mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-11 17:56:18 +03:00
Merge branch 'main' into eps_plugin_perf
This commit is contained in:
commit
651b3521ac
|
@ -369,21 +369,21 @@ Build Options
|
|||
available, as many as are present.
|
||||
|
||||
* Build flags: ``--disable-zlib``, ``--disable-jpeg``,
|
||||
``--disable-tiff``, ``--disable-freetype``, ``--disable-lcms``,
|
||||
``--disable-webp``, ``--disable-webpmux``, ``--disable-jpeg2000``,
|
||||
``--disable-imagequant``, ``--disable-xcb``.
|
||||
``--disable-tiff``, ``--disable-freetype``, ``--disable-raqm``,
|
||||
``--disable-lcms``, ``--disable-webp``, ``--disable-webpmux``,
|
||||
``--disable-jpeg2000``, ``--disable-imagequant``, ``--disable-xcb``.
|
||||
Disable building the corresponding feature even if the development
|
||||
libraries are present on the building machine.
|
||||
|
||||
* Build flags: ``--enable-zlib``, ``--enable-jpeg``,
|
||||
``--enable-tiff``, ``--enable-freetype``, ``--enable-lcms``,
|
||||
``--enable-webp``, ``--enable-webpmux``, ``--enable-jpeg2000``,
|
||||
``--enable-imagequant``, ``--enable-xcb``.
|
||||
``--enable-tiff``, ``--enable-freetype``, ``--enable-raqm``,
|
||||
``--enable-lcms``, ``--enable-webp``, ``--enable-webpmux``,
|
||||
``--enable-jpeg2000``, ``--enable-imagequant``, ``--enable-xcb``.
|
||||
Require that the corresponding feature is built. The build will raise
|
||||
an exception if the libraries are not found. Webpmux (WebP metadata)
|
||||
relies on WebP support. Tcl and Tk also must be used together.
|
||||
|
||||
* Build flags: ``--vendor-raqm --vendor-fribidi``
|
||||
* Build flags: ``--vendor-raqm``, ``--vendor-fribidi``.
|
||||
These flags are used to compile a modified version of libraqm and
|
||||
a shim that dynamically loads libfribidi at runtime. These are
|
||||
used to compile the standard Pillow wheels. Compiling libraqm requires
|
||||
|
|
|
@ -339,21 +339,22 @@ class EpsImageFile(ImageFile.ImageFile):
|
|||
raise OSError(msg)
|
||||
|
||||
def _find_offset(self, fp):
|
||||
s = fp.read(160)
|
||||
s = fp.read(4)
|
||||
|
||||
if s[:4] == b"%!PS":
|
||||
if s == b"%!PS":
|
||||
# for HEAD without binary preview
|
||||
fp.seek(0, io.SEEK_END)
|
||||
length = fp.tell()
|
||||
offset = 0
|
||||
elif i32(s, 0) == 0xC6D3D0C5:
|
||||
elif i32(s) == 0xC6D3D0C5:
|
||||
# FIX for: Some EPS file not handled correctly / issue #302
|
||||
# EPS can contain binary data
|
||||
# or start directly with latin coding
|
||||
# more info see:
|
||||
# https://web.archive.org/web/20160528181353/http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf
|
||||
offset = i32(s, 4)
|
||||
length = i32(s, 8)
|
||||
s = fp.read(8)
|
||||
offset = i32(s)
|
||||
length = i32(s, 4)
|
||||
else:
|
||||
msg = "not an EPS file"
|
||||
raise SyntaxError(msg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user