[File] [PATCH] Magdir/ole2compounddocs for Ulead iPhoto Template *.TPL

Jörg Jenderek joerg.jen.der.ek at gmx.net
Sun Sep 11 18:54:01 UTC 2022


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

Hello,

Some weeks ago i send patches for Ulead Imaginfo thumbnails. When
running newest file command ( version > 5.42 with images 1.226) it
shows now more information. The IMAGINFO.PE? examples are now
described as "Ulead Imaginfo thumbnail". Also the original directory
with images like "E:\iPE\CDSample\Images\PCD" and the image type like
JPG or pcd is displayed by phrase like "with JPG images". For some
examples "with TPL images" is shown. So i look for such images. I
found these in sub directory Template in program directory of
software iPhoto Plus version 4.

When running file command version 5.42 with -e cdf option on such
examples i get an output like:

BIRTH1-A.TPL: OLE 2 Compound Document, v3.62, SecID 0x1,
	      16 FAT sectors, Mini FAT start sector 0x2,
	      3 Mini FAT sectors : UNKNOWN with names
	      TplHeader TplMainImage TplPreviewImage
BIRTHIN1.TPL: OLE 2 Compound Document, v3.62, SecID 0x1,
	      14 FAT sectors, Mini FAT start sector 0x2,
	      5 Mini FAT sectors : UNKNOWN with names
	      TplHeader TplMainImage TplPreviewImage
SALE.TPL:     OLE 2 Compound Document, v3.62, SecID 0x1,
	      47 FAT sectors, Mini FAT start sector 0x2,
	      6 Mini FAT sectors : UNKNOWN with names
	      TplHeader TplMainImage TplPreviewImage
VALENT1.TPL:  OLE 2 Compound Document, v3.62, SecID 0x1,
	      18 FAT sectors, Mini FAT start sector 0x2,
	      4 Mini FAT sectors : UNKNOWN with names
	      TplHeader TplMainImage TplPreviewImage

Furthermore only generic mime type application/x-ole-storage is
shown with -i and -e cdf option. With option --extension only 3 byte
sequence ??? is shown.

When running file command with -e soft or no extra option for
inspected examples i get a output like:

BIRTH1-A.TPL: Composite Document File V2 Document,
	      Cannot read section info
BIRTHIN1.TPL: Composite Document File V2 Document,
	      Cannot read section info
SALE.TPL:     Composite Document File V2 Document,
	      Cannot read section info
VALENT1.TPL:  Composite Document File V2 Document,
	      Cannot read section info

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This identifies also
all examples with low priority as "Generic OLE2 / Multistream
Compound" by docfile.trid.xml. The examples are described with high
rate as "Ulead iPhoto Template" by tpl-ulead.trid.xml (See appended
trid-v-tpl.txt.gz).

For comparison reason i also run the file format identification
utility DROID ( See https://sourceforge.net/projects/droid/). This
identifies the examples generic as "OLE2 Compound Document Format"
by fmt/111 Signature (See appended droid-tpl-ulead.csv.gz).

Unfortunately i found no little hint with information about file
format. When searching for information i at least get a link with CD
download of software "iPhoto Plus 4". This contains such TPL
samples. So i choose that as reference URL. A little bit of
information about file name suffix can be found on web sites
filext.com and file-extensions.org. That informations are now
expressed by comment lines inside Magdir/ole2compounddocs like:
# URL:		https://archive.org/details/iPhoto-Plus-4
#		https://filext.com/file-extension/TPL
# Reference:	http://mark0.net/download/triddefs_xml.7z
#		defs/t/tpl-ulead.trid.xml
# https://www.file-extensions.org/
# tpl-file-extension-ulead-photo-express-template

The examples are recognized as "OLE 2 Compound Document"
by starting bytes (\320\317\021\340\241\261\032\341) at the beginning
inside Magdir/ole2compounddocs. Obviously there exist no code
fragment to do sub class identification. So the examples are
described as "UNKNOWN".

Furthermore the examples have no registered Root storage object
CLSID or this value is nil. In that case file command would display
afterwords this information by a phrase like
", clsid 0xc0c7266eb98cd311a1c800c04f612452". That means that in
branch handling CLSID GUID 0 code must be added. The similar entry
was Corel Gallery (*.GAL), because Corel bought the Ulead company.
The file command was not able to do sub classification, but it
display directory entry names. So second one apparently seems to be
always TplHeader, third seems to be TplMainImage and forth seems to
be TplPreview encoded at UTF-16 string after first directory entry,
which is always "Root Entry". So i add afterwards lines for my
inspected examples. That looks like:
 >>>>128 lestring16	TplHeader	: Ulead iPhoto Template
 !:mime	image/x-ulead-tpl
 !:ext	tpl
Instead of generic application/x-ole-storage i choose an user
defined one that meets image and Ulead as producer.

After applying the above mentioned modifications by patch
file-ole2compounddocs-tpl.diff then all my inspected Ulead examples
are now described with more details. This now looks with -e cdf
option like:

BIRTH1-A.TPL: OLE 2 Compound Document, v3.62, SecID 0x1,
	      16 FAT sectors, Mini FAT start sector 0x2,
	      3 Mini FAT sectors :
	      Ulead iPhoto Template
BIRTHIN1.TPL: OLE 2 Compound Document, v3.62, SecID 0x1,
	      14 FAT sectors, Mini FAT start sector 0x2,
	      5 Mini FAT sectors :
	      Ulead iPhoto Template
SALE.TPL:     OLE 2 Compound Document, v3.62, SecID 0x1,
	      47 FAT sectors, Mini FAT start sector 0x2,
	      6 Mini FAT sectors :
	      Ulead iPhoto Template
VALENT1.TPL:  OLE 2 Compound Document, v3.62, SecID 0x1,
	      18 FAT sectors, Mini FAT start sector 0x2,
	      4 Mini FAT sectors :
	      Ulead iPhoto Template

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

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

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYx4uyQAKCRCv8rHJQhrU
1rvVAJ0YS1JZsniyO3r/2t9IiNJxX0HwvACfWU2gTeQmfeTgHbizClnB9u2lDe0=
=lpvj
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: droid-tpl-ulead.csv.gz
Type: application/x-gzip
Size: 364 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220911/534507e9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trid-v-tpl.txt.gz
Type: application/x-gzip
Size: 649 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220911/534507e9/attachment-0001.bin>
-------------- next part --------------
--- file-5.42/magic/Magdir/ole2compounddocs.old	2022-05-31 19:38:36.000000000 +0200
+++ file-5.42/magic/Magdir/ole2compounddocs	2022-09-11 20:38:07.350974500 +0200
@@ -232,14 +232,26 @@
 >>>>256 	lestring16	_INFO_			: Corel Gallery
 # second directory entry name _ITEM_ or _DATA_
 # later directory entry names: _ALBUM_ _THUMBNAIL_
 #!:mime	application/x-ole-storage
 !:mime	application/x-corel-gal
 !:ext	gal
 #
+# From:		Joerg Jenderek
+# URL:		https://archive.org/details/iPhoto-Plus-4
+#		https://filext.com/file-extension/TPL
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/t/tpl-ulead.trid.xml
+# Note:		found in Template sub directory in program directory of software iPhoto Plus version 4
+# second, third and fourth directory entry name like TplHeader TplMainImage TplPreview
+>>>>128 	lestring16	TplHeader		: Ulead iPhoto Template
+#!:mime	application/x-ole-storage
+!:mime	image/x-ulead-tpl
+# https://www.file-extensions.org/tpl-file-extension-ulead-photo-express-template
+!:ext	tpl
+#
 # URL:	https://en.wikipedia.org/wiki/Hangul_(word_processor)
 # Note:	"HWP Document File" signature found in FileHeader
 # Second directory entry name FileHeader hint for Thinkfree Office document
 >>>>128 	lestring16	FileHeader		: Hangul (Korean) 5.0 Word Processor File
 #!:mime	application/haansofthwp
 !:mime	application/x-hwp
 # https://example-files.online-convert.com/document/hwp/example.hwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.42-ole2compounddocs-tpl.diff.sig
Type: application/octet-stream
Size: 909 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220911/534507e9/attachment.obj>


More information about the File mailing list