-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script to create thumbnails/previews of selected images #384
base: master
Are you sure you want to change the base?
Conversation
You are correct about the documentation. IIRC I wrote the documentation while the code was still a work in progress. I finally set the code up to use min/max and handle it correctly internally. But, it seems I forgot to go back and update the documentation. |
Documentation is updated to reflect the way the code works. EDIT: At least at darktable-org.github.io/luadocs |
After looking through the code and reading everything, I'm somewhat confused. Are you trying to generate a full set of cache images, a full resolution preview, or a full size preview, or something else that I didn't name? Generating caches for sizes 0-8 is a waste of time and a waste of disk space. You only need 3 sizes of cache images (or 2 if you don't use the filmstrip). The sizes are:
Size 8 is the full resolution preview. To produce it requires the pixelpipe and therefore takes a second or 2 on an unprocessed image. I don't bother pre-generating them because the cost is not worth the time and storage. If I'm doing a full preview culling and want to see the full resolution image I just generate it then, with a middle click on the image. |
@wpferguson Ty for your response and correcting the API documentation. The main purpose of this script for me is to generate the full size 100% previews. Why I need this? I shoot mostly wildlife and macro where you can never be sure if the focus is on the right spot or if there is motion blur in the image. That's why I shoot bursts, so I end up with many images with more or less the same content. Back at home I only want to keep one of the images of a burst. To be able to decide which image to keep I use the preview at 100% (middle mouse button). Generating this image (45MP) takes 3 sec on my PC. When I'm comming home from a shooting with 1000 images is is quite annoying to wait a thousand time 3 seconds. Maybe I should not generate all thumbnail sizes < 8. But I can not hardcode the sizes which are needed as this script shall be general purpose and not tailored to my system. Perhaps it is possible to determine the width of the darktable window and the amount of rows, then the script could compute which thumbnail sizes are needed. Another topic: Is it possible to get the information which modifier key was hold when the 'create thumbnails' button was pressed? This would allow me to implement another behaviour in those cases, like only generate the 100% previews when SHIFT is holed or delete all cached images if CTRL is holed. |
Hi, and thanks a lot for doing my work 🤣. Some ideas and suggestions:
|
@ChristianBirzer: I have implemented the first and scond point of your list of suggestions. I have to think a bit more about the third point. |
The correct tooltip text of the script's buttons do not appear, instead it is always 'images', it looks like a bug to me: The corresponding documentation can be found here: https://darktable-org.github.io/luadocs/lua.api.manual/darktable/gui/libs/image/#darktableguilibsimageregister_action @wpferguson Can you have a look at this? |
Thanks a lot. A few days ago I played a bit with the preferences (just to learn...) and also thought about my third suggestion. |
Sorry to chime in lately here, but maybe this points can help (or not... in this case just ignore my comment !) :
|
Here's a snapshot of how I'm doing it The options are
It addition to the above
I see caching as a "set it and forget it" type of application, so I think putting the settings in the lua options is the best place for them rather than taking up space in the lighttable.
It could use some love :) |
Sorry for the long delay, but I am unsure about how to proceed. About @wpferguson implementation: I like the automatic generation of thumbnails on import. But I think additionally to that a button to trigger this manually is needed as well, for example when a user opens an already imported film roll that has no thumbnails yet (e.g. because the thumbnails were deleted in the past). Furthermore I think we dont have to give the user the option to specify directly which thumbnail size they want, instead we could given them these three options and determin the corresponding thumbnail size (0-8) by using the display resolution:
|
In my opinion (and my workflow) both is very useful (not to say 'needed'). The automatic generation on import and the manual generation. I think the preconfigured selection you suggest is very handy. Even if I don't know which sizes shall be in which selection. I'd like either have the checkboxes like you suggest where I can select all or have a drop down selection with an additional entry for 'all sizes'. I'm not sure which one is better. |
This script adds a button 'create thumbnails' to 'selected image[s]' module of darktable's lighttable view. When this button is pressed full sized previews of all selected images are created.
Btw.: I noticed a discrepancy between the lua API description and the implementation of
dt_lua_image_t.generate_cache
.In the API documentation the last two parameters are called start_size and end_size.
In the code they are called min and max.
But not only their names are different but also the behaviour is not like described in the API documentation. When max/start_size is greater than min/end_size no image is added to the cache. But the API states "When generating multiple sizes put the largest size as the start size and the smallest as the end".