@@ -74,7 +74,6 @@ function escape_js_string(str)
7474end
7575
7676local function export_thumbnail (image , filename )
77- dt .print (" export thumbnail image " .. filename )
7877 exporter = dt .new_format (" jpeg" )
7978 exporter .quality = 90
8079 exporter .max_height = 512
@@ -108,14 +107,21 @@ function exiftool_get_image_dimensions(filename)
108107 end
109108end
110109
110+ local function stop_job (job )
111+ job .valid = false
112+ end
113+
111114local function fill_gallery_table (images_ordered , images_table , title , dest_dir , sizes , exiftool )
112115 dest_dir = dest_dir .. " /images"
113116 local gallery_data = { name = escape_js_string (title ) }
114117
115118 local images = {}
116119 local index = 1
120+ local job = dt .gui .create_job (" exporting thumbnail images" , true , stop_job )
121+
117122 for i , image in pairs (images_ordered ) do
118123 local filename = images_table [image ]
124+ dt .print (" exporting thumbnail image " .. index .. " /" ..# images_ordered )
119125 write_image (image , dest_dir , filename )
120126
121127 if exiftool then
@@ -129,9 +135,11 @@ local function fill_gallery_table(images_ordered, images_table, title, dest_dir,
129135 width = width , height = height }
130136
131137 images [index ] = entry
138+ job .percent = index / # images_ordered
132139 index = index + 1
133140 end
134141
142+ stop_job (job )
135143 gallery_data .images = images
136144 return gallery_data
137145end
@@ -175,7 +183,7 @@ local function copy_static_files(dest_dir)
175183 " index.html" ,
176184 " gallery.css" ,
177185 " modal.css" ,
178- " modal.js" ,
186+ " modal.js" ,
179187 " gallery.js" ,
180188 " fullscreen.js"
181189 }
0 commit comments