Build thumbnail images driving darktable 4.2 with lua

Hello,
I have looked at the various lua scripts available. All the scripts seem to use ImageMagick to build thumbnail images.
I’m trying to build a lua script to generate web album.
I was wondering if you can export images from darktable via lua in webp format for example in different sizes.

That should be possible, yes.

You can export files in any format supported by the exporter (with the exception of jxl?). See darktable lua documentation - types

While trying to implement a widget I notice none of the existing module with a widget seem to work.
For example ‘selection_to_pdf’ should activate a widget in the lighttable view but none is displayed when activating via script manager.
I’m using the macos version with darktable version 4.2.0.

selection_to_pdf adds an entry to the target storage drop down of the export module. Just tested on Linux and it works fine.

You’re right. Sorry for the noise.

I’ve made big progress. This code allows me to produce images of different sizes.

wa.exporter = dt.new_format(“jpeg”)
wa.exporter.quality = 80
wa.exporter.max_height = max_height
wa.exporter.max_width = max_width
wa.exporter:write_image(image, export_file)

I need to get back the exact size of the image that was produced.
This image is no longer in darktable.
Can I use a darktable function to get information on that image ?