From a9849c86b0321accfd583a41dfb8aaf06e2ee614 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Jan 2009 13:00:03 -0800 Subject: [PATCH 1/3] Describe your change here --- src/calibre/ebooks/lrf/comic/convert_from.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/lrf/comic/convert_from.py b/src/calibre/ebooks/lrf/comic/convert_from.py index 70b4eb8b43..7517766323 100755 --- a/src/calibre/ebooks/lrf/comic/convert_from.py +++ b/src/calibre/ebooks/lrf/comic/convert_from.py @@ -51,7 +51,7 @@ PROFILES = { # Name : (width, height) in pixels 'prs500':(584, 754), # The SONY's LRF renderer (on the PRS500) only uses the first 800x600 block of the image - 'prs500-landscape': (784, 1200-92) + 'prs500-landscape': (784, 1012) } def extract_comic(path_to_comic_file): @@ -401,6 +401,9 @@ def create_pdf(pages, profile, opts, thumbnail=None): raise RuntimeError('Failed to load reportlab') pdf = canvas.Canvas(filename=opts.output, pagesize=(width,height+15)) + pdf.setAuthor(opts.author) + pdf.setTitle(opts.title) + for page in pages: pdf.drawImage(page, x=0,y=0,width=width, height=height) From 77328e9d47a2bc52b292f3c5e6fc58877ffd3542 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Jan 2009 16:49:36 -0800 Subject: [PATCH 2/3] Recipe for Joel on Software (thanks to Darko Miletic) --- .../gui2/images/news/joelonsoftware.png | Bin 0 -> 390 bytes src/calibre/web/feeds/recipes/__init__.py | 1 + .../feeds/recipes/recipe_joelonsoftware.py | 24 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 src/calibre/gui2/images/news/joelonsoftware.png create mode 100644 src/calibre/web/feeds/recipes/recipe_joelonsoftware.py diff --git a/src/calibre/gui2/images/news/joelonsoftware.png b/src/calibre/gui2/images/news/joelonsoftware.png new file mode 100644 index 0000000000000000000000000000000000000000..9f21608105cee21770f15f020a8478cf764e9528 GIT binary patch literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%b@U_I1CZGssfk$L9 zkoEv$x0Bg+Ai=T%$8;bK*3S@gZ0%tnXT7J3V~EA+-r$40M-+I9{olB{ea<+Sa_4!I zQ`M9xrz~c(jkjZxdm35F+n2;Jc}{4Vx$yhGH;F0}WEkY8FY%EKcDOWAMtiZV`p(=* zD^8e}&kwuxZo$mIYr{YC$1UQz$5O_=%5~D|=`)!2eqXwGj%VFEab2-j%a+`>-?+8l zQ~eo*oH-nm9=!X!_buPk+p4-viD%Cg9Mw6(!?G~yM(V|;KU01LPq?1X)|dJI!abpE zwnlven-x)ep5#UYovvEq8c~v5l$uzQs+$5N7>o=IEOiYGbq&ly49%=eOsx!oTnj4$ sgU&a+1uzY{`6-!cl^7a~46RIztc(pH8XoB}f Date: Tue, 6 Jan 2009 17:58:40 -0800 Subject: [PATCH 3/3] IGN:... --- src/calibre/ebooks/lrf/comic/convert_from.py | 35 ++++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/calibre/ebooks/lrf/comic/convert_from.py b/src/calibre/ebooks/lrf/comic/convert_from.py index 7517766323..21c2587d10 100755 --- a/src/calibre/ebooks/lrf/comic/convert_from.py +++ b/src/calibre/ebooks/lrf/comic/convert_from.py @@ -11,10 +11,10 @@ import os, sys, shutil, traceback, textwrap from uuid import uuid4 try: - from reportlab.pdfgen import canvas - _reportlab = True + from reportlab.pdfgen import canvas + _reportlab = True except: - _reportlab = False + _reportlab = False @@ -325,7 +325,7 @@ def config(defaults=None,output_format='lrf'): c.add_opt('no_progress_bar', ['--no-progress-bar'], default=False, help=_("Don't show progress bar.")) if output_format == 'pdf': - c.add_opt('no_process',['--no_process'], default=False, + c.add_opt('no_process',['--no_process'], default=False, help=_("Apply no processing to the image")) return c @@ -406,9 +406,8 @@ def create_pdf(pages, profile, opts, thumbnail=None): for page in pages: - pdf.drawImage(page, x=0,y=0,width=width, height=height) - pdf.showPage() - + pdf.drawImage(page, x=0,y=0,width=width, height=height) + pdf.showPage() # Write the document to disk pdf.save() @@ -427,22 +426,22 @@ def do_convert(path_to_file, opts, notification=lambda m, p: p, output_format='l if not pages: raise ValueError('Could not find any pages in the comic: %s'%source) if not opts.no_process: - pages, failures, tdir2 = process_pages(pages, opts, notification) - if not pages: - raise ValueError('Could not find any valid pages in the comic: %s'%source) - if failures: - print 'Could not process the following pages (run with --verbose to see why):' - for f in failures: - print '\t', f - thumbnail = os.path.join(tdir2, 'thumbnail.png') - if not os.access(thumbnail, os.R_OK): - thumbnail = None + pages, failures, tdir2 = process_pages(pages, opts, notification) + if not pages: + raise ValueError('Could not find any valid pages in the comic: %s'%source) + if failures: + print 'Could not process the following pages (run with --verbose to see why):' + for f in failures: + print '\t', f + thumbnail = os.path.join(tdir2, 'thumbnail.png') + if not os.access(thumbnail, os.R_OK): + thumbnail = None if output_format == 'lrf': create_lrf(pages, opts.profile, opts, thumbnail=thumbnail) if output_format == 'epub': create_epub(pages, opts.profile, opts, thumbnail=thumbnail) if output_format == 'pdf': - create_pdf(pages, opts.profile, opts, thumbnail=thumbnail) + create_pdf(pages, opts.profile, opts, thumbnail=thumbnail) shutil.rmtree(tdir) if not opts.no_process: shutil.rmtree(tdir2)