aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/pdfresources_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/pdfresources_controller.rb b/app/controllers/pdfresources_controller.rb
index a7df8d8..f1634a2 100644
--- a/app/controllers/pdfresources_controller.rb
+++ b/app/controllers/pdfresources_controller.rb
@@ -70,9 +70,10 @@ class PdfresourcesController < ApplicationController
end
if File.exist?(reduced_image_path)
+ fn = resource.name.strip.downcase.gsub("\s", "_") << "_page-"
image_blob = ActiveStorage::Blob.create_and_upload!(
io: File.open(reduced_image_path),
- filename: "page-#{index + 1}.jpg",
+ filename: "#{fn}#{index + 1}.jpg",
content_type: 'image/jpg'
)
resource.pdf_snapshots.attach(image_blob)