[digiKam-users] User script in Batch Queue Manager

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[digiKam-users] User script in Batch Queue Manager

Dmitri Popov-2
Hello,

Recently, I stumbled upon the User Script tool in Batch Queue Manage. Since it's completely undocumented, I can't figure out how it works. Say I need to run jpeg-recompress on all images in the current job. The command has the following format:

jpeg-recompress -quality high original.jpeg result.jpeg

What would it look like in the User Script tool?

Thank you,
Dmitri
Reply | Threaded
Open this post in threaded view
|

Re: User script in Batch Queue Manager

Maik Qualmann
Hi Dmitri,

For your example it would be right:

 jpeg-recompress -quality high $INPUT $OUTPUT

The peculiarity of the script is that it is assumed that a new target file
($OUTPUT) is always created. Should e.g. only metadata on the original image
are changed, you have to add a copy process yourself in the script. So
depending on the operating system:

 cp $INPUT $OUTPUT

Then only the $OUTPUT file can be changed using a shell command.
Whether the new file then overwrites the original file or is created as a new
one with a different name depends on the settings in BQM.

Maik

Am Donnerstag, 23. April 2020, 16:33:29 CEST schrieb Dmitri Popov:

> Hello,
>
> Recently, I stumbled upon the User Script tool in Batch Queue Manage. Since
> it's completely undocumented, I can't figure out how it works. Say I need
> to run jpeg-recompress on all images in the current job. The command has
> the following format:
>
> jpeg-recompress -quality high original.jpeg result.jpeg
>
> What would it look like in the User Script tool?
>
> Thank you,
> Dmitri




Reply | Threaded
Open this post in threaded view
|

Re: User script in Batch Queue Manager

Dmitri Popov-2
Hi Maik,

Thank you very much for your reply! It all makes sense now.

Kind regards,
Dmitri


tor. 23. apr. 2020 19.53 skrev Maik Qualmann <[hidden email]>:
Hi Dmitri,

For your example it would be right:

 jpeg-recompress -quality high $INPUT $OUTPUT

The peculiarity of the script is that it is assumed that a new target file
($OUTPUT) is always created. Should e.g. only metadata on the original image
are changed, you have to add a copy process yourself in the script. So
depending on the operating system:

 cp $INPUT $OUTPUT

Then only the $OUTPUT file can be changed using a shell command.
Whether the new file then overwrites the original file or is created as a new
one with a different name depends on the settings in BQM.

Maik

Am Donnerstag, 23. April 2020, 16:33:29 CEST schrieb Dmitri Popov:
> Hello,
>
> Recently, I stumbled upon the User Script tool in Batch Queue Manage. Since
> it's completely undocumented, I can't figure out how it works. Say I need
> to run jpeg-recompress on all images in the current job. The command has
> the following format:
>
> jpeg-recompress -quality high original.jpeg result.jpeg
>
> What would it look like in the User Script tool?
>
> Thank you,
> Dmitri