remove crop debugging
This commit is contained in:
parent
f01807bfa7
commit
7b826468d8
2 changed files with 1 additions and 3 deletions
|
@ -100,9 +100,8 @@ class CropHandler(OMLHandler):
|
||||||
with db.session():
|
with db.session():
|
||||||
item = Item.get(id)
|
item = Item.get(id)
|
||||||
path = item.get_path()
|
path = item.get_path()
|
||||||
print(path, page, left, top, right, bottom)
|
|
||||||
data = crop(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-Type', 'image/jpeg')
|
||||||
self.set_header('Content-Length', str(len(data)))
|
self.set_header('Content-Length', str(len(data)))
|
||||||
self.write(data)
|
self.write(data)
|
||||||
|
|
|
@ -105,7 +105,6 @@ def crop(pdf, page, left, top, right, bottom):
|
||||||
if image:
|
if image:
|
||||||
image = image[0]
|
image = image[0]
|
||||||
crop = [int(p) for p in (left, top, right, bottom)]
|
crop = [int(p) for p in (left, top, right, bottom)]
|
||||||
print(crop)
|
|
||||||
img = Image.open(image).crop(crop)
|
img = Image.open(image).crop(crop)
|
||||||
img.save(image)
|
img.save(image)
|
||||||
with open(image, 'rb') as fd:
|
with open(image, 'rb') as fd:
|
||||||
|
|
Loading…
Reference in a new issue