From c04bb15eec5064ffec9e91508610f2977c62dd89 Mon Sep 17 00:00:00 2001 From: itec78 Date: Tue, 11 May 2021 15:00:32 +0200 Subject: [PATCH 1/4] fixed page number --- randstrip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randstrip.py b/randstrip.py index 2e6af0b..b20596a 100755 --- a/randstrip.py +++ b/randstrip.py @@ -257,7 +257,7 @@ if __name__ == "__main__": quit() pagePdf = list() - for pag in range(0,int(args.multiple[0]/6)+1): + for pag in range(0,int((args.multiple[0]-1)/6+1)): pagePdf.append(Image.new('RGB',(2479,3508),(255,255,255))) for ist,strip_num in enumerate(range(0,args.multiple[0])): From 46e58b850274ea83d21fbcc5633b79801f839ea0 Mon Sep 17 00:00:00 2001 From: itec78 Date: Tue, 11 May 2021 15:03:02 +0200 Subject: [PATCH 2/4] added borders --- randstrip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/randstrip.py b/randstrip.py index b20596a..8d1409b 100755 --- a/randstrip.py +++ b/randstrip.py @@ -130,6 +130,7 @@ def writeStrip(story,config): for vign in strip: image.paste(vign,(xshift,0)) xshift += config["panelLength"] + ImageDraw.Draw(image).rectangle([0,0,config["xSize"]-1,config["ySize"]-1], fill=None, outline="black", width=1) return image def createStrip(config,specialPlatform=""): @@ -262,7 +263,7 @@ if __name__ == "__main__": for ist,strip_num in enumerate(range(0,args.multiple[0])): pagePdf[nopage].paste(pdfs[strip_num],box=(110,ypos)) - ypos += 516 + ypos += 516 + 20 if ypos > 3508-569: ypos = 100 nopage += 1 From 3d1f36cb8b278837f674ee40c118e7f21a0f6438 Mon Sep 17 00:00:00 2001 From: itec78 Date: Tue, 11 May 2021 15:04:08 +0200 Subject: [PATCH 3/4] added link --- randstrip.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/randstrip.py b/randstrip.py index 8d1409b..249bd0c 100755 --- a/randstrip.py +++ b/randstrip.py @@ -130,7 +130,7 @@ def writeStrip(story,config): for vign in strip: image.paste(vign,(xshift,0)) xshift += config["panelLength"] - ImageDraw.Draw(image).rectangle([0,0,config["xSize"]-1,config["ySize"]-1], fill=None, outline="black", width=1) + ImageDraw.Draw(image).rectangle([0,0,config["xSize"]-1,config["ySize"]-1], fill=None, outline="black", width=1) return image def createStrip(config,specialPlatform=""): @@ -259,7 +259,10 @@ if __name__ == "__main__": pagePdf = list() for pag in range(0,int((args.multiple[0]-1)/6+1)): - pagePdf.append(Image.new('RGB',(2479,3508),(255,255,255))) + image = Image.new('RGB',(2479,3508),(255,255,255)) + fnt = ImageFont.truetype(config["font"],config["fontSize"]) + ImageDraw.Draw(image).text((2479 - 500, 3508 - 200),"https://github.com/oloturia/fumcaso",fill="black",font=fnt) + pagePdf.append(image) for ist,strip_num in enumerate(range(0,args.multiple[0])): pagePdf[nopage].paste(pdfs[strip_num],box=(110,ypos)) From d939f704b2f445c0cee3cb0149c0801f6b6a65cc Mon Sep 17 00:00:00 2001 From: itec78 Date: Tue, 11 May 2021 15:23:53 +0200 Subject: [PATCH 4/4] fixed pdf resolution --- randstrip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randstrip.py b/randstrip.py index 249bd0c..408bbad 100755 --- a/randstrip.py +++ b/randstrip.py @@ -272,4 +272,4 @@ if __name__ == "__main__": nopage += 1 if fileName[len(fileName)-4:] != ".pdf": fileName += ".pdf" - pagePdf[0].save(fileName,save_all=True, append_images=pagePdf[1:]) + pagePdf[0].save(fileName, resolution=300, save_all=True, append_images=pagePdf[1:])