From c8dcd2513b877c4429e723b23b4048773e59d33b Mon Sep 17 00:00:00 2001
From: Daniel Neuwirth <daniel.neuwirth@dataport.de>
Date: Tue, 10 Dec 2019 07:57:19 +0000
Subject: [PATCH] fix for ending1

---
 ckanext/odsh/pdf_to_thumbnail/enqueue.py   | 1 -
 ckanext/odsh/pdf_to_thumbnail/thumbnail.py | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/ckanext/odsh/pdf_to_thumbnail/enqueue.py b/ckanext/odsh/pdf_to_thumbnail/enqueue.py
index c7840794..99109322 100644
--- a/ckanext/odsh/pdf_to_thumbnail/enqueue.py
+++ b/ckanext/odsh/pdf_to_thumbnail/enqueue.py
@@ -99,7 +99,6 @@ def enqueue_after_delete(context, resources):
         private = package.private
         package_id = package.id
         first_resource = resources[0]
-        package_id = first_resource.get('package_id')
         
         # without the background job
         create_thumbnail_for_last_resource(resources, private, package_id)
diff --git a/ckanext/odsh/pdf_to_thumbnail/thumbnail.py b/ckanext/odsh/pdf_to_thumbnail/thumbnail.py
index d5343017..ac8b6fcf 100644
--- a/ckanext/odsh/pdf_to_thumbnail/thumbnail.py
+++ b/ckanext/odsh/pdf_to_thumbnail/thumbnail.py
@@ -65,11 +65,11 @@ def create_thumbnail_from_file(file, package_id, private):
         old_filepath = get_filepath_for_thumbnail(concatenate_filename(filename))
         if os.path.exists(old_filepath):
             os.remove(old_filepath)
-    convert_from_bytes(file_read,
-                       dpi = 50,
-                       #size=(width, None),
+    path_to_image = convert_from_bytes(file_read,
+                       size=(width, None),
                        output_folder=directory,
                        output_file=filename,
+                       single_file = True,
                        first_page=0,
                        last_page=0,
                        fmt='jpg'
-- 
GitLab