Is it possible to export XMP files in the batch processor?

Started by JoseGil, July 25, 2019, 04:55:12 PM

Previous topic - Next topic

JoseGil

Hi
I am exporting some JPEG files by means of the batch processor and I would also like to export the XMP sidecar files.
I've tried changing the metadata options in Tools -> Batch Processor - > Metadata and in Edit -> Preferences -> Metadata, but I haven't found how to do it
Could you give me some clue?
Thanks in advance

Mario

JPEG files always use embedded XMP data. If you enable some of the metadata export options in the Batch Processor, it will embed XMP data in the output file. Other applications will pick it up from there.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JoseGil

Thanks Mario but I need to export the XMP sidecar files at the same time as I export some processed images (size reduction, watermarks, ...) because an external application treats these XMP.

To solve this, I have created an small app that:
1 - launch a batch processor using favoriteExecute
2 - copies the xmp files by means of processRun

I enclose the functions responsible for launching these two processes in case it may interest someone:

            // Launch batch processor 'Export (1000 x 1000 JPG)'
            function export_foto(fileId) {
               IMatch.favoriteExecute({
                    guid: '49A2439A-B3FC-4F9F-BF78-E3A80DF842CD',     
                    op: 'primary',
                    id: fileId
                }).then(function(response) {
                    console.log('Exportació de fotografia ' + fileId + ' realitzada correctament');
                });
            }

            // Export XMP file
            function export_XMP_sidecar_file(filenameOrigin, xmpPathTarget) {
                xmpFilenameOrigin = filenameOrigin.substr(0, files[index].fileName.lastIndexOf(".")) + ".XMP";
                parametres = '/C copy  /Y "' + xmpFilenameOrigin + '" "'+ xmpPathTarget +'"';
                console.log( 'parameters IMatch.processRun() = ' + parametres );

                IMatch.processRun({
                            'executable' : 'cmd.exe',
                            'parameters' : parametres,
                            'showwindow' : false,
                            'timeout' : 30
                        }).then(function(response) {
                                if (response.result == 'ok') {
                                    console.log('export OK');
                                }
                                else {
                                    console.log(JSON.stringify(response,null,2));                         
                                }
                            },function(error){
                                console.log(error.responseText);
                            });
            }


Related links:
https://www.photools.com/community/index.php?topic=6851.0;prev_next=prev#new

Mario

Thanks for sharing  :)


Which external application do you use which does not support standard embedded XMP data in JPEG?
By definition and industry standard, XMP should always be embedded in JPEG, PNG, TIF, PSD etc. Having separate sidecar files may cause duplicate metadata and potentially corruption. Depends on your workflow of course.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JoseGil

To read the XMP files I use a software called FME. With this software I synchronize with other databases. FME can read the JPEG metadata but I have several running scripts that, at the moment, I don't want to modify.

Thank you for your interest!