mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-12 16:24:45 +03:00
Add optional size parameter to load for the EPS file loader. This allows an EPS file to be rasterized at a specified resolution other than integer multiples of the file specified bounding box as is the case with the scale parameter.
This commit is contained in:
parent
46ad0e2555
commit
7873dfc5cb
|
@ -330,10 +330,13 @@ class EpsImageFile(ImageFile.ImageFile):
|
|||
|
||||
return (length, offset)
|
||||
|
||||
def load(self, scale=1):
|
||||
def load(self, scale=1, size=None):
|
||||
# Load EPS via Ghostscript
|
||||
if not self.tile:
|
||||
return
|
||||
# Override the size of the image if specified
|
||||
if not size is None:
|
||||
self.size = size
|
||||
self.im = Ghostscript(self.tile, self.size, self.fp, scale)
|
||||
self.mode = self.im.mode
|
||||
self.size = self.im.size
|
||||
|
|
Loading…
Reference in New Issue
Block a user