forked from 0x2620/pandora
fix typo
This commit is contained in:
parent
eaad9badbb
commit
a0b3a144c6
1 changed files with 2 additions and 2 deletions
|
@ -540,7 +540,7 @@ class Document(models.Model, FulltextMixin):
|
||||||
if size:
|
if size:
|
||||||
path = os.path.join(folder, '%dp%d.jpg' % (size, page))
|
path = os.path.join(folder, '%dp%d.jpg' % (size, page))
|
||||||
if len(crop) == 4:
|
if len(crop) == 4:
|
||||||
path = os.path.join(folder, '%dp%d,%s.jpg' % (1024, page, ','.join(map(str, crop)))
|
path = os.path.join(folder, '%dp%d,%s.jpg' % (1024, page, ','.join(map(str, crop))))
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
img = Image.open(src).crop(crop)
|
img = Image.open(src).crop(crop)
|
||||||
img.save(path)
|
img.save(path)
|
||||||
|
@ -548,7 +548,7 @@ class Document(models.Model, FulltextMixin):
|
||||||
img = Image.open(path)
|
img = Image.open(path)
|
||||||
src = path
|
src = path
|
||||||
if size < max(img.size):
|
if size < max(img.size):
|
||||||
path = os.path.join(folder, '%dp%d,%s.jpg' % (size, page, ','.join(map(str, crop)))
|
path = os.path.join(folder, '%dp%d,%s.jpg' % (size, page, ','.join(map(str, crop))))
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
resize_image(src, path, size=size)
|
resize_image(src, path, size=size)
|
||||||
elif self.extension in ('jpg', 'png', 'gif'):
|
elif self.extension in ('jpg', 'png', 'gif'):
|
||||||
|
|
Loading…
Reference in a new issue