[File] [PATCH] of Magdir/images for oldest version of Corel Draw Picture *.cdr

Jörg Jenderek joerg.jen.der.ek at gmx.net
Sun Jan 29 03:06:05 UTC 2023


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

Hello,

some times ago (5 Jun 2020) i send patch Magdir/riff for older Corel
Draw Picture, which often have file name suffix CDR. Now i get some
older version of such Corel Draw Pictures.

When i run file command version 5.44 on such older Corel samples and
related test samples i get an output like:

911.CDR:                       RIFF (little-endian) data,
			       Corel Draw Picture,
			       version 3, 9094 bytes
BEETHOV1.CDR:                  RIFF (little-endian) data,
			       Corel Draw Picture,
			       version '4' 4.4, 29714 bytes
FLOWER.CDR:                    data
fmt-464-signature-id-723.cdr:  RIFF (little-endian) data,
			       Corel Draw,
			       version '5', 8 bytes
fmt-465-signature-id-722.cdr:  RIFF (little-endian) data,
			       Corel Draw,
			       version '4', 8 bytes
fmt-466-signature-id-725.cdr:  data
fmt-467-signature-id-726.cdr:  data
x-fmt-29-signature-id-374.cdr: RIFF (little-endian) data,
			       Corel Draw,
			       version '6', 8 bytes

With option -i only generic application/octet-stream is shown for
oldest version. Furthermore with --extension option only ??? is
displayed for oldest version instead of cdr.

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). The not oldest
samples are described with low rate as "Generic RIFF container" by
riff.trid.xml. With highest priority such samples are described as
"CorelDraw Document" by cdr.trid.xml. The oldest version samples like
FLOWER.CDR are described as "CorelDRAW drawing (generic)" by
cdr-gen.trid.xml. Most oldest examples are described with highest
priority as "CorelDRAW drawing (v2.0)" by cdr-corel-20.trid.xml. One
of the oldest samples fmt-467-signature-id-726.cdr is described as
"CorelDRAW drawing (v1.0)" by cdr-corel-10.trid.xml (See appended
trid-v-corel_1-2.txt.gz).

For comparison reason i also run the file format identification
utility DROID ( See https://sourceforge.net/projects/droid/). Here
all CDR examples described as "CorelDraw Drawing". It does do also a
sub classification. What is described by TrID as "CorelDRAW drawing
(v1.0)" is described here with additional version "1.0" by PUID
fmt/467. What is described by TrID as "CorelDRAW drawing (v2.0)" is
described here with additional version "2.0" by PUID fmt/466 (See
appended droid-cdr.csv.gz).

TrID list the used file name extension and often with -v option the
related URL pointing to some information. So i found a page about
CorelDRAW on file formats archive team website and on Wikipedia. This
is now expressed by comment lines inside Magdir/images like:
# URL:		http://fileformats.archiveteam.org/wiki/CorelDRAW
#		https://en.wikipedia.org/wiki/CorelDRAW
# Reference:	http://mark0.net/download/triddefs_xml.7z
#		defs/c/cdr-gen.trid.xml
#		defs/c/cdr-corel-10.trid.xml
#		defs/c/cdr-corel-10.trid.xml

There i also found links to some file format informations.

> From version 3 Corel Draw Pictures are RIFF based. Such samples
> are
already handled by Magdir/riff. From version 14 the riff part is
packed in a ZIP container. Such samples are already handled by
Magdir/archive.

So this session is about the oldest versions (1 until 2). There exist
an entry for other Corel images inside Magdir/images. So i add new
entry after "Corel Photo-Paint image" entry and before "Crunch
compressed texture" entry.

According to documentation such old pictures start with 2 byte phrase
WL. According to TrID and DROID at offset 3 is a nil byte. The byte
at offset 2 is letter e (0x6D) for version 1.0 and letter (0x6D) for
version 2.0. The DROID tool checks also more bytes afterwards. IT
assumes that for version 1.0 this is followed by byte sequence
0x45000000 and for version 2.0 this is 0xed080000 or 0x25050000.
Instead of generic mime type application/octet-stream is use the type
used by riff variant. So this additional lines now looks like:

 0 ubelong&0xFFffF7ff	0x574C6500	Corel Draw Picture
 !:mime					application/vnd.corel-draw
 !:ext					cdr
 >2	ubyte		0x65		\b, version 1.0
 #>>4	ubelong		!0x45000000	\b, at 4 %#8.8x
 >2	ubyte		0x6D		\b, version 2.0
 #>>4	ubelong		!0xed080000
 #>>>4	ubelong		!0x25050000	\b, at 4 %#8.8x

After applying the above mentioned modifications by patch
file-5.44-images-cdr.diff and using also Magdir/riff then now also
oldest version samples are described. So now this looks like:
911.CDR:                       RIFF (little-endian) data,
			       Corel Draw Picture,
			       version 3, 9094 bytes
BEETHOV1.CDR:                  RIFF (little-endian) data,
			       Corel Draw Picture,
			       version '4' 4.4, 29714 bytes
FLOWER.CDR:                    Corel Draw Picture,
			       version 2.0
fmt-464-signature-id-723.cdr:  RIFF (little-endian) data,
			       Corel Draw,
			       version '5', 8 bytes
fmt-465-signature-id-722.cdr:  RIFF (little-endian) data,
			       Corel Draw,
			       version '4', 8 bytes
fmt-466-signature-id-725.cdr:  Corel Draw Picture,
			       version 2.0
fmt-467-signature-id-726.cdr:  Corel Draw Picture,
			       version 1.0
x-fmt-29-signature-id-374.cdr: RIFF (little-endian) data,
			       Corel Draw,
			       version '6', 8 bytes
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+v8rHJQhrU1gUCY9XinQAKCRCv8rHJQhrU
1sCoAJ42wpe5EXZmnxL5E6dGyT79iB1UgQCg21acbY6gHeOAYHmvfcvPODfuSu8=
=KftH
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trid-v-corel_1-2.txt.gz
Type: application/x-gzip
Size: 1011 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230129/a9a85f42/attachment.bin>
-------------- next part --------------
--- file-5.44/magic/Magdir/images.old	2022-11-30 00:04:06.000000000 +0100
+++ file-5.44/magic/Magdir/images	2023-01-29 03:42:08.238707800 +0100
@@ -3919,6 +3919,29 @@
 #	display ICC/ICM color profile by ./icc
 #>>>0x154	use		color-profile
 
+# URL:		http://fileformats.archiveteam.org/wiki/CorelDRAW
+#		https://en.wikipedia.org/wiki/CorelDRAW
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/c/cdr-gen.trid.xml
+# Note:		called "CorelDRAW drawing (generic)" by TrID
+#		version til 2 WL-based; from version 3 til 13 handled by ./riff and from 14 zip based handled by ./archive
+0	ubelong&0xFFffF7ff	0x574C6500	Corel Draw Picture
+#!:mime						image/x-coreldraw
+!:mime						application/vnd.corel-draw
+!:ext						cdr
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/c/cdr-corel-10.trid.xml
+# Note:		called "CorelDRAW drawing (v1.0)" by TrID and
+#		"CorelDraw Drawing" with version "1.0" by DROID via PUID fmt/467
+#		only DROID fmt-467-signature-id-726.cdr example
+>2	ubyte			0x65		\b, version 1.0
+#>>4	ubelong			!0x45000000	\b, at 4 %#8.8x
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/c/cdr-corel-20.trid.xml
+# Note:		called "CorelDRAW drawing (v2.0)" by TrID and
+#		"CorelDraw Drawing" with version "2.0" by DROID via PUID fmt/466
+>2	ubyte			0x6D		\b, version 2.0
+# According to DROID 0xed080000 or 0x25050000
+#>>4	ubelong			!0xed080000
+#>>>4	ubelong			!0x25050000	\b, at 4 %#8.8x
+
 # Type: Crunch compressed texture.
 # From: David Korth <gerbilsoft at gerbilsoft.com>
 # References:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.44-images-cdr.diff.sig
Type: application/octet-stream
Size: 884 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230129/a9a85f42/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: droid-cdr.csv.gz
Type: application/x-gzip
Size: 448 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230129/a9a85f42/attachment-0001.bin>


More information about the File mailing list