Copy values from one XMP tag to another XMP tag - metadata

I have a lot of images (JPG) with some metadata.
I'm interested in these three tags, for example, from one of the images:
[XMP] FlightPitchDegree : 0.734793
[XMP] FlightRollDegree : -1.024403
[XMP] FlightYawDegree : 192.286436
I need to copy these values for each image to the next tags:
Xmp.Camera.Pitch
Xmp.Camera.Roll
Xmp.Camera.Yaw
Mostly for tag editing, I'm using ExifTool, but I can't find commands for copying values between tags inside one file.
I'll be very appreciative of any recommendation.
Best,
Andriy

To copy from one tag to another you would use the redirection feature of the -TagsFromFile option. Basically it would be
exiftool "-TARGETTAG<SOURCETAG" file.xmp
You have the names of the SourceTags (FlightPitchDegree/FlightRollDegree/FlightYawDegree), you just need to figure out the exiftool names of your target tags. I can find CameraPitch/CameraYaw/CameraRoll tags on the DJI Tags page, but those are not XMP tags. The only other place I can find tags with similar names are part of the XMP-Camera group, which are not built into exiftool and you would have to download the pix4d.config file and use the -Config option to include those definitions.
exiftool -config /path/to/pix4d.config "-XMP:Pitch< FlightPitchDegree" "-XMP:Yaw<FlightYawDegree" "-XMP:Roll< FlightRollDegree" file.xmp
The -config option must be the very first option in the command in order to load the definitions.

Related

How to use Exiftool to copy jpg metadata to RAW file after exporting from Lightroom

Using Lightroom, I made adjustments to some jpg files (primarily to the toning), as well as added some IPTC data. I saved the metadata to those files and also exported them.
Now I would like to copy just the IPTC and edit adjustments from either the sorce jpgs or the exported jpgs into their corresponding RAW files, but I'm not sure of the syntax or tags to specify.
This is my folder structure:
.\Working
.\Working\RAW_Source\
.\Working\JPG_Source\
.\Working\JPG_Exports\
Notes:
all file names are the same except for their extensions.
there are no sidecar files involved. Metadata needs to exist ONLY in the jpg
or RAW files.
Thanks
Assuming that the files have the same base name, your basic command would be along these lines.
To copy from JPG_Source to RAW_Source
exiftool -TagsFromFile .\Working\JPG_Source\%f.jpg -xmp:all -iptc:all .\Working\RAW_Source\
To copy from JPG_Exports to RAW_Source
exiftool -TagsFromFile .\Working\JPG_Exports\%f.jpg -xmp:all -iptc:all .\Working\RAW_Source\
To copy tags from either source (latter DIR has priority)
exiftool -TagsFromFile .\Working\JPG_Exports\%f.jpg -xmp:all -iptc:all -TagsFromFile .\Working\JPG_Source\%f.jpg -xmp:all -iptc:all .\Working\RAW_Source\
That will copy all XMP tags (which includes IPTC Core) and IPTC IIM/Legacy tags to the RAW files.
These commands would create backup files which can be suppressed with the -Overwrite_Original option. You can recurse into subdirectories with the -r (recurse) option.
These commands do not include any GPS tags or EXIF tags. You can add the GPS tags by adding -GPS:All to the command. It's usually not a good idea to edit tags in the EXIF group in RAW files unless you know exactly what you are doing, as it can cause the RAW file to become unviewable, as some of these tags are needed to tell software how to render the image (see ExifTool FAQ #8).
Also take note that these command write the data directly into the RAW file. If you wish to write the data into an XMP sidecar file, the command would be more complex, depending upon whether the XMP sidecar files already exists or not. If the sidecar files already exist, then you would add -ext XMP to the above commands.

asciidoc: is there a way to create an anchor that will be visible in libreoffice writer?

Tl;dr;
What is the correct way to create an anchor in docbook? and is there a way that will make the anchor visible in writer?
Background
I am trying to split up documentation that was previously in single open office documents into smaller asciidoc documents which are both included in the main open office document and also converted to either or both of html & pdf.
I have this mostly working. I use asciidoctor to create html. asciidoctor-pdf to create pdf and a combination of asciidoctor and pandoc to create .odt files. I also tried the python implementation of asciidoc but found the interface less useable.
Round tripping between asciidoc and odt is obviously not possible. This is sort of a fusion where the master document is word processed but pieces of content that can be produced independently (think man pages - in fact that is one of several use cases) are included.
asciidoc to html:
asciidoctor -b html5 foo.adoc -o foo.html
asciidoc to pdf:
asciidoctor-pdf -b pdf foo.adoc -o foo.pdf
asciidoc to odt
asciidoctor -b docbook foo.adoc -o foo.docbook
pandoc --base-header-level=3 -V date:"" -V title:"" -f docbook foo.docbook -o foo.odt
With pandoc I have to nullify the date and title and set the header-level as desired for the section to be inserted as an extra complication.
I insert the resulting .odt into the main document using insert section inside open office.
Note that the main document is not a master document as I could not find a way of creating a master document without also automatically splitting the file on h1 boundaries.
I have two main problems to resolve with this set-up. I would like to add headings in the asciidoc document as cross references and also create entries for them in the alphabetical index (actually the first heading would be suffcient). Is there a way to do this?
Index markers in asciidoc do not result in entries in .odt file being created.
I am able to cross reference content in the inserted section using "insert reference/heading" and referencing the uniquely named header. However, whenever I use "update all" these cross references are invalidated. They are shown as "Error: Reference source not found".
[On a separate note I would also like a way to find broken cross references automatically]
I am currently using libreoffice - Version: 4.3.7.2
I am not adverse to switching version or flavours (i.e. apache) if one behaves better than the other.
I'm not sure if the answer is in the asciidoc or docbook parts of the chain. I would accept an answer which inserts a index entry at the start of the inserted section (top of the .adoc/docbook file) automatically.
I am also open to changing my toolchain to something that will work.
For example I tried the asciidoc-odt backend and fell foul of https://github.com/dagwieers/asciidoc-odf/issues/47 which does not inspire confidence.
Using asciidoc-odt I avoid the need to create an intermediate docbook file. However, I still can't get the anchor to appear.
I can get a macro to create an anchor but at present I haven't figured out how to run the macro from the command line.
To create an anchor in DocBook, make an inline anchor in the .adoc file. For example, giving this to asciidoctor:
[[X1]]Section1
---------------
produced this:
<title>
<anchor xml:id="X1" xreflabel="[X1]"/>
Section1
</title>
Conversely, putting this on separate lines did not create an anchor tag in my test:
[[X1]]
Section 1
Now for some bad news. From the Pandoc User's Guide:
Internal links are currently supported for HTML formats (including HTML slide shows and EPUB), LaTeX, and ConTeXt.
I interpret this to mean that currently, Pandoc does not create internal links in Writer. When I tried it, the link was ignored.
Note: It looks like I did not answer all of your questions. If you want to ask more about LibreOffice cross references and headings (the big bold paragraph towards the end of the question), maybe you could make a separate question just for that part.

How to use helm-etags with a TAGS file that includes other tag files?

I used exuberant ctags to create my tags file with the --etags-include option and i see the included tags file in the main TAGS file. But when i try to use helm-etags, it doesn't dig into the included tags file.
Is it even possible?
you may try
https://github.com/jixiuf/helm-etags-plus
it support multiple tag files.
(setq tags-table-list '("/path/of/TAGS1" "/path/of/TAG2"))

Concatenate content of TAGS files from different directories

I'm referring to TAGS file generated by ctags or etags in order to have some code navigation in Emacs with M-..
The typical project looks like this:
Large standard library (more than 100 files, but rarely updated).
Project-specific library (updated on the daily basis).
I would like the project to be able to use two (or maybe more TAGS files), but regenerate only the portion of them, only the ones used inside the particular project. How would I approach this problem?
etags --help:
-i FILE, --include=FILE
Include a note in tag file indicating that, when searching for
a tag, one should also consult the tags file FILE after
checking the current file.

Repeating elements/links in org pages to be published as html?

Is there a simple way to add something like the {Back to Worg's index} to every .org page in a directory which I plan to publish with org-publish-project-alist? Is this accomplished with a #+ tag, or some definition in the .css file?
I looked at how they did it on Worg, and it doesn't look like CSS.
There are a few ways you might be able to do so.
Create a generic file that only includes the details you want in each file. For example:
[[./index.org][Back to index]]
Then use #+include: <filename> at the location in your file where you want the line. (See Include Files)
Alternately you could define a macro in a setupfile (See In-Buffer Settings) that is the definition of the link (or multiple link choices)
#+macro: toIndex [[./index.org][Back to index]]
In both cases it is worth noting that the relative paths are based on the exported file. So a [[../index.org]] will always point to the index.org file in the parent directory, no matter where the setupfile is.