[File] [PATCH] of Magdir/archive for OpenDocument; templates, extensions

Christos Zoulas christos at zoulas.com
Tue Mar 10 01:19:29 UTC 2020


Committed, thanks!

christos

> On Mar 9, 2020, at 9:47 AM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Hello,
> 
> some days ago i handled many ZIP archives. Some are just containers
> used to store OpenDocument files (*.od?) or templates (*.ot?).
> 
> When running file command i get sometimes strange results. Then for
> comparison reasons i create some test files according to OpenDocument
> rules. When running file command version 5.38 on such OpenDocuments i
> get an output like:
> 
> CD Envelope Template 1_2.otg:     OpenDocument Template
> firebird_integer_ods12.odb:       OpenDocument Database
> manual_DE.odm:                    OpenDocument Master Document
> manual_EN.odt:                    OpenDocument Text
> Modern_business_letter_serif.ott: OpenDocument Text Template
> My-odf.odf:                       OpenDocument Formula
> My-oth.oth:                       OpenDocument HTML Document Template
> ooo_20_basis.otp:                 OpenDocument Template
> OOoReise.ots:                     OpenDocument Template
> PDF Feature Matrix.ods:           OpenDocument Spreadsheet
> SimplePresentation.odp:           OpenDocument Presentation
> test-database.odb:                OpenDocument Database
> test-odc.odc:                     OpenDocument Chart
> test-odi.odi:                     OpenDocument Image
> test-otc.otc:                     OpenDocument Template
> test-otf.otf:                     OpenDocument Template
> test-oti.oti:                     OpenDocument Template
> UBCDLABEL.odg:                    OpenDocument Drawing
> 
> For many templates only "OpenDocument Template" is shown without sub
> type classification. So for example OOoReise.ots the precisely phrase
> OpenDocument Spreadsheet Template should be shown. On the other hand
> for some sub classes the correct type is displayed like "OpenDocument
> Text Template" for example Modern_business_letter_serif.ott.
> Furthermore with --extension option only ??? is displayed.
> 
> Unfortunately the Wikipedia about OpenDocument does not mention all
> available sub types. So i take information about OpenDocument file
> format found at file formats archive team. So i add to Magdir/archive
> a comment line like
> #   URL: http://fileformats.archiveteam.org/wiki/OpenDocument
> 
> Inside Magdir/archive the part for OpenDocument Spreadsheet Template
> looks like
>>>>> 84	string	-template		Template
> !:mime	application/vnd.oasis.opendocument.spreadsheet-template
> 
> So i add sub type description before template phrase and after mime
> type line i add line to show file name extension. So this now looks l
> ike
>>>>> 84	string	-template		Spreadsheet Template
> !:mime	application/vnd.oasis.opendocument.spreadsheet-template
> !:ext	ots
> Then do the the same procedure for the other incomplete OpenDocument
> templates.
> 
> In older OpenOffice 1.x databases "application/vnd.sun.xml.base" was
> used as mime type. In newer OpenDocument type changed officially
> registered at IANA to "application/vnd.oasis.opendocument.database"
> with sub type database instead base. Unfortunately there exist a bug,
> that also the base sub type is used as mime type inside ZIP packed
> oth files. So 2 variants for OTH samples exist. That is expressed by
> magic lines
> 
>>>> 73	string	database		Database
> !:mime	application/vnd.oasis.opendocument.database
> !:ext	odb
> #
>>>> 73	string	base 			Database
> !:mime	application/vnd.oasis.opendocument.database
> !:ext	odb
> 
> After applying the above mentioned modifications by patch
> file-5.38-archive-OpenDocument.diff then i get output with precise
> sub class descriptions and correct file names extension like:
> 
> CD Envelope Template 1_2.otg:     OpenDocument Drawing Template
> firebird_integer_ods12.odb:       OpenDocument Database
> manual_DE.odm:                    OpenDocument Master Document
> manual_EN.odt:                    OpenDocument Text
> Modern_business_letter_serif.ott: OpenDocument Text Template
> My-odf.odf:                       OpenDocument Formula
> My-oth.oth:                       OpenDocument HTML Document Template
> ooo_20_basis.otp:                 OpenDocument Presentation Template
> OOoReise.ots:                     OpenDocument Spreadsheet Template
> PDF Feature Matrix.ods:           OpenDocument Spreadsheet
> SimplePresentation.odp:           OpenDocument Presentation
> test-database.odb:                OpenDocument Database
> test-odc.odc:                     OpenDocument Chart
> test-odi.odi:                     OpenDocument Image
> test-otc.otc:                     OpenDocument Chart Template
> test-otf.otf:                     OpenDocument Formula Template
> test-oti.oti:                     OpenDocument Image Template
> UBCDLABEL.odg:                    OpenDocument Drawing
> 
> 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+v8rHJQhrU1gUCXmZI8wAKCRCv8rHJQhrU
> 1h8xAJ4xEO3MALYRtjR/yHO/orahWHkyCQCcCdwCAGPCWIjynrd4BBfPEIgvGZc=
> =Qk1h
> -----END PGP SIGNATURE-----
> <file-5_38-archive-OpenDocument_diff.DEFANGED-51><file-5_38-archive-OpenDocument_diff_sig.DEFANGED-52>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20200309/7230a6ef/attachment.asc>


More information about the File mailing list