[File] [PATCH] of Magdir/wordprocessors for Star-, Open-, Libre-Office Gallery *.sdg

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu May 21 19:19:37 UTC 2020


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

some weeks ago i run file command inside LibreOffice directories. In
sub directory gallery there files of Office Galleries are stored.

Apparently a gallery consist of some files. For every gallery beside
the theme files with thm file name extension and OLE 2 Compound
Document with sdv extension there exist a third component with
extension sdg. Such examples are described by file command
version 5.38 only as data.
The same gallery format is already used in old StarOffice 5.2 dated
about May 2000. And the format is still used in newer LibreOffice
with version 6.3.2.2. The gallery is also used in OpenOffice 3.2.0.

Some information about StarOffice Gallery is found on file formats
archive team site. So i add comment line to Magdir/wordprocessors lik
e:
 # URL:	http://fileformats.archiveteam.org/wiki/StarOffice_Gallery
Unfortunately i find no file format specification for such SDG parts.
So i rely on my own observations.

All SDG examples start with the same 4 byte sequence. This is used
as  test by line
 0	string		SGA3	StarOffice Gallery thumbnails

Some sites on the net call the SDG samples like "StarOffice Gallery
images", but such files are already used in successor software
OpenOffice and LibreOffice. The file name extension is shown by line
 !:ext		sdg
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-sdg

For every gallery object the SDG part contains a "short" sequence
starting with "SGA3" magic. At offset eleven seems to start the
image part with the same magic. That can be shown for debugging
purpose by line like:
 >11	string		x	\b, image magic '%-.2s'

I always get string BM which looks like the magic of Windows PC
bitmaps. But when i try to inspect gallery image magic by calling
magic lines of Magdir/images i often get phrase like "PC bitmap,
Windows 3.x format, 80 x 50 x 8, 16794707 compression" via
 >11	indirect	x	\b; contains

So this is a small Windows bitmap with an unknown compression
method or another image format. Because i am unsure about this
item, i put image format lines only as comments. Because size of
that images inside SDG files is small, especially when compared
with original stored images, the embedded images seems to be
preview images or thumbnail images. So i choose as description the
text "StarOffice Gallery thumbnails".

After applying the above mentioned modifications by patch
file-5.37-wordprocessors-sdg.diff then i get a describing output like

neues thema1.sdg: StarOffice Gallery thumbnails
sounds.sdg:       StarOffice Gallery thumbnails

I hope my diff file can be applied in future version of
file utility.

With best wishes
Jörg Jenderek
- --
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iFwEARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXsbUMgAKCRCv8rHJQhrU
1v1XAKCVQ75QsWLBiaOPBefgJeV5mBk/3gCYzL2EHsAKa7VCphrFRLSNqAtORA==
=X7pj
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.38/magic/Magdir/wordprocessors.old	2019-10-25 21:15:49 +0000
+++ file-5.38/magic/Magdir/wordprocessors	2020-05-21 19:12:52 +0000
@@ -300,5 +300,22 @@
 # if available then display first object name 
 >>(2.s+4)	ulelong		>0
 # partial file name, URL or internal name like "dd2*" of 1st object or RESRV
 >>>(2.s+11)	pstring/h	x		\b, 1st %s
 
+# From:	Joerg Jenderek
+# URL:	http://fileformats.archiveteam.org/wiki/StarOffice_Gallery
+# Note:	used in Star-, Open- and Libre-Office and found in directories like
+#	%APPDATA%\Roaming\LibreOffice\4\user\gallery
+#	$HOME/.config/libreoffice/4/user/gallery
+0	string		SGA3	StarOffice Gallery thumbnails
+# Unknown like 0x04000?0001000142
+#>4	ubequad		x	\b, UNKNOWN 0x%16.16llx
+#!:mime	application/x-sdg
+!:mime	application/x-stargallery-sdg
+!:ext	sdg
+# display image magic for debugging purpose like 'BM'
+# looking like PC bitmap, Windows 3.x format with unknown compression
+#>11	string		x	\b, image magic '%-.2s'
+# inspect 1st GALLERY thumbnail magic by ./images with 1 space at end
+#>11	indirect	x	\b; contains 
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.38-wordprocessors-sdg.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200521/5edd2f13/attachment.obj>


More information about the File mailing list