From 7b826468d874824d5ed5963125eea1d892e8a54c Mon Sep 17 00:00:00 2001 From: j Date: Mon, 10 Jun 2024 16:26:27 +0100 Subject: [PATCH] remove crop debugging --- oml/item/handlers.py | 3 +-- oml/media/pdf.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/oml/item/handlers.py b/oml/item/handlers.py index 8f892b5..901e579 100644 --- a/oml/item/handlers.py +++ b/oml/item/handlers.py @@ -100,9 +100,8 @@ class CropHandler(OMLHandler): with db.session(): item = Item.get(id) path = item.get_path() - print(path, page, left, top, right, bottom) data = crop(path, page, left, top, right, bottom) - if data: + if path and data: self.set_header('Content-Type', 'image/jpeg') self.set_header('Content-Length', str(len(data))) self.write(data) diff --git a/oml/media/pdf.py b/oml/media/pdf.py index 96d27ed..2f58d9a 100644 --- a/oml/media/pdf.py +++ b/oml/media/pdf.py @@ -105,7 +105,6 @@ def crop(pdf, page, left, top, right, bottom): if image: image = image[0] crop = [int(p) for p in (left, top, right, bottom)] - print(crop) img = Image.open(image).crop(crop) img.save(image) with open(image, 'rb') as fd: