fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a0fa09c
)
add option to generate covers with non-standard aspect ratio
author
Jan Szejko
<janek37@gmail.com>
Mon, 14 May 2018 14:54:57 +0000
(16:54 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Mon, 14 May 2018 14:54:57 +0000
(16:54 +0200)
src/catalogue/management/commands/gencover.py
patch
|
blob
|
history
diff --git
a/src/catalogue/management/commands/gencover.py
b/src/catalogue/management/commands/gencover.py
index
5afd1ba
..
420ea63
100644
(file)
--- a/
src/catalogue/management/commands/gencover.py
+++ b/
src/catalogue/management/commands/gencover.py
@@
-11,13
+11,15
@@
from librarian.cover import make_cover
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('slug')
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('slug')
- parser.add_argument('size', type=int)
+ parser.add_argument('--width', type=int)
+ parser.add_argument('--height', type=int)
parser.add_argument('--bleed', action='store_true')
def handle(self, *args, **options):
slug = options['slug']
parser.add_argument('--bleed', action='store_true')
def handle(self, *args, **options):
slug = options['slug']
- size = options['size']
+ width = options['width']
+ height = options.get('height')
bleed = 20 if options['bleed'] else 0
wldoc = Book.objects.get(slug=slug).wldocument()
bleed = 20 if options['bleed'] else 0
wldoc = Book.objects.get(slug=slug).wldocument()
- cover = make_cover(wldoc.book_info, width=
size
, bleed=bleed)
+ cover = make_cover(wldoc.book_info, width=
width, height=height
, bleed=bleed)
cover.save('%s.jpg' % slug)
cover.save('%s.jpg' % slug)