Hi there, I was wondering how to use a custom shell script in the batchQueueManager but can"t find anything in the official documentation. Would you mind define this part in? Regards
It is important for the BQM to know that always a $OUTPUT file has to be created. So, if your script does not create a new image, for example, just change metadata, you must always first copy $INPUT to $OUTPUT in the script. Then you can make the changes to $OUTPUT. Maik
Hello Malk, Do you have a simple example to share? Regards
Here is a simple example that removes all metadata with exiftool from a image (There is also a tool in the BQM for this). As I said, the cp command is only necessary if the shell command does not create a new target ($OUTPUT). ------------------------------------------ cp $INPUT $OUTPUT exiftool -all= -overwrite_original $OUTPUT ------------------------------------------ Maik
Git commit 0c2ff42f9ef06e22e93a510c345b1f543371e484 by Gilles Caulier. Committed on 20/01/2023 at 09:27. Pushed by cgilles into branch 'master'. start to write BQM Custom Script section on online manual M +1 -1 TODO M +1 -0 batch_queue.rst M +1 -1 batch_queue/base_tools.rst M +1 -1 batch_queue/batchqueue_overview.rst A +22 -0 batch_queue/custom_script.rst R +- -- batch_queue/images/bqm_base_tools_view.webp [from: batch_queue/images/base_tools_view.webp - 100% similarity] A +- -- batch_queue/images/bqm_custom_script.webp R +- -- batch_queue/images/bqm_main_view.webp [from: batch_queue/images/batch_queue.webp - 100% similarity] R +- -- batch_queue/images/bqm_raw_converter.webp [from: batch_queue/images/raw_converter.webp - 100% similarity] M +1 -1 batch_queue/raw_converter.rst M +4 -0 index.rst https://invent.kde.org/documentation/digikam-doc/commit/0c2ff42f9ef06e22e93a510c345b1f543371e484
Git commit 97e850e09dec6d295a88f6fb5afdff64dd64b2f4 by Gilles Caulier. Committed on 20/01/2023 at 10:21. Pushed by cgilles into branch 'master'. Custom Script BQM toom doc++ M +33 -0 batch_queue/custom_script.rst https://invent.kde.org/documentation/digikam-doc/commit/97e850e09dec6d295a88f6fb5afdff64dd64b2f4
Git commit c0e5ccd8dba15ef312851237fb8fd479ae32041d by Gilles Caulier. Committed on 20/01/2023 at 13:49. Pushed by cgilles into branch 'master'. add details about return code managed by Custom Script add first example of script code M +34 -1 batch_queue/custom_script.rst https://invent.kde.org/documentation/digikam-doc/commit/c0e5ccd8dba15ef312851237fb8fd479ae32041d
Git commit 37d2d10f3c0d572f1cd2350cd24c6181ba04310f by Gilles Caulier. Committed on 20/01/2023 at 14:46. Pushed by cgilles into branch 'master'. BQM Custom Script: add second example using ImageMagick to add a watermark over an image. FIXED-IN: 8.0.0 M +26 -2 batch_queue/custom_script.rst A +- -- batch_queue/images/bqm_imagemagick_watermark.webp https://invent.kde.org/documentation/digikam-doc/commit/37d2d10f3c0d572f1cd2350cd24c6181ba04310f
Maik, Please take a look to the User Script BQM tool online doc to see l’m wrong somewhere or if something can be improved : https://docs.digikam.org/en/batch_queue/custom_script.html Gilles
Two things, you already wrote it, but maybe a little more clearly, that a new file is always expected on $OUTPUT. So with script programs that do not create a new file (e.g. changing metadata) you must first copy $INPUT to $OUTPUT with a command appropriate to the operating system and then make the changes to $OUTPUT. On Windows, it's not a Batch script that we're running. I don't know any way how to run a script with cmd.exe. If you know one, we can change it. Powershell can probably do it. We split the digiKam script lines and join them with " && " and start the cmd.exe with the /C option. Before: command1 command2 command3 After: cmd.exe /C command1 && command2 && command3 Therefore, under Windows, the script should not contain any blank lines or comment lines. Maik
I think if we save the script temporarily on Windows beforehand, we can run it with the cmd.exe. Maik
Git commit f801eb48cf1a707450e30073fd5257fdf8aa5e22 by Gilles Caulier. Committed on 21/01/2023 at 04:34. Pushed by cgilles into branch 'master'. Add comments from Maik M +17 -6 batch_queue/custom_script.rst https://invent.kde.org/documentation/digikam-doc/commit/f801eb48cf1a707450e30073fd5257fdf8aa5e22
Git commit 833ebbb6ec5896e860a24a1189bd9b681c3bae84 by Maik Qualmann. Committed on 21/01/2023 at 07:15. Pushed by mqualmann into branch 'master'. try to start a real batch script on Windows M +38 -14 core/dplugins/bqm/custom/userscript/userscript.cpp https://invent.kde.org/graphics/digikam/commit/833ebbb6ec5896e860a24a1189bd9b681c3bae84
Batch script works now fine on Windows. Maik
Great. In the doc we write that empty lines and comments are prohibited. This is always the case ? Gilles
No, this passage in the doc can now be removed again. Maik
Git commit 397c9e4d0a2c437e50c09ecc0e9023f000f8dfb0 by Gilles Caulier. Committed on 21/01/2023 at 16:06. Pushed by cgilles into branch 'master'. remove obsolte notes for Windows M +1 -1 batch_queue/custom_script.rst https://invent.kde.org/documentation/digikam-doc/commit/397c9e4d0a2c437e50c09ecc0e9023f000f8dfb0
Gilles, did you see that there is a merge request in the doc repository? Maik
No. I don't understand why we are not automatically in CC... I take a look.
*** Bug 471492 has been marked as a duplicate of this bug. ***
Can't make scripts work without constantly getting "Failed to process item..." & "Failed to create file..." however occasionally file is there after refreshing. Applies for both images and sound. BQM seems to have base tool for cropping but why it's not possible to do cropping to center as it would possibly be the most likely use case? There's plenty of very nice tools in this software but these could be made more intuitive and effective to use.