Author Topic: thm.trid.xml for Star-,Open-,Libre-Office Gallery (*.thm)  (Read 148 times)

jenderek

  • Full Member
  • ***
  • Posts: 102
thm.trid.xml for Star-,Open-,Libre-Office Gallery (*.thm)
« on: October 26, 2019, 03:34:03 PM »
Hello trid users,

some days ago i run TrID inside LibreOffice directories. In sub directory
gallery there files of Office Galleries are stored. The samples with file
name extension thm are described as "Unknown!" ( see appended
output/trid-old.txt).

The newest version of file command { en.wikipedia.org/wiki/File_(command) }
describes such thm-files as "StarOffice Gallery theme". See appended
output/file-new.txt.

So i run tridscan to generate a definition file thm.trid.xml. Unfortunately
i found no documentation about such gallery file format. At least one note
is mentioned on sub page about StarOffice binary formats on file formats
archive team site. This is expressed by reference line:
   <RefURL>
   http://fileformats.archiveteam.org/wiki/StarOffice_binary_formats
   </RefURL>

Apparently such THM files already seems to start with the same 2 byte
sequence. This is expressed by XML construct:

   <Bytes>0400</Bytes>
   <Pos>0</Pos>

Afterwards Gallery name length is stored at offset 2 as short
integer. Lowest found value was 2 for sg16.thm with name "3D". For bad
example like file2147.chk here null occurs. The theme name of Gallery is
stored as Pascal string. So printable string name starts at offset 4. So
mention this fact in remark line.

After the gallery name the number of gallery objects is stored as long
integer. A Gallery can be empty. In this case it contains 0 objects.

Three bytes behind the object number the name of the first object
name is stored as Pascal string. This can be an "internal" name like
d2194, an URL like file:///P:/Pictures/1999_1024_23_Tikal.jpg or a
partial file name like /sounds/apert2.wav.

In all THM samples the ASCII keyword GALRESRV appears near the end. This is
expressed in global string section by line:

   <String>GALRESRV</String>

I also look for older versions. The same gallery format is used in old
StarOffice 5.2 dated about May 2000. And the format is still used in actual
LibreOffice with version 6.3.2.2 and it also used in OpenOffice.

Some sites on the net call the THM samples like "OpenOffice.org
configuration", but such files are already used in predecessor
software StarOffice. Furthermore the THM files only occur in the
context of a Gallery and contain the theme name of the gallery.
Therefore i choose describing text "StarOffice Gallery theme".
This also a reasonable for abbreviation thm for theme. This
abbreviation is used as file name extension, which is shown by
following line:
   <Ext>THM</Ext>

Using other StarOffice mime types mentioned on OpenOffice site as
guide line i choose a user defined mime type by line
   <Mime>application/x-stargallery-thm</Mime>

With the new trid definition all THM examples are now described ( see
appended output/trid-new-v.txt). TrID definitions, some examples and output
are stored in archive thm_test.zip. I hope that my XML file can be used in
future version of triddefs.

Furthermore a gallery consist of some files. For every gallery beside the
SDG file there seems to exist files with same main name but with extension
sdv, thm and sometimes str. I will try to handle the remaining files types
in a future session.

With best wishes
Jörg Jenderek

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 1932
    • Mark0's Home Page
Re: thm.trid.xml for Star-,Open-,Libre-Office Gallery (*.thm)
« Reply #1 on: October 26, 2019, 07:46:18 PM »
Thanks, as usual!