summaryrefslogtreecommitdiff
path: root/magic/Magdir/riff
diff options
context:
space:
mode:
Diffstat (limited to 'magic/Magdir/riff')
-rw-r--r--magic/Magdir/riff123
1 files changed, 114 insertions, 9 deletions
diff --git a/magic/Magdir/riff b/magic/Magdir/riff
index 33d439aca7db..33d31fe75a74 100644
--- a/magic/Magdir/riff
+++ b/magic/Magdir/riff
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: riff,v 1.34 2019/04/19 00:42:27 christos Exp $
+# $File: riff,v 1.35 2020/06/05 17:15:03 christos Exp $
# riff: file(1) magic for RIFF format
# See
#
@@ -120,11 +120,33 @@
!:mime audio/x-wav
>>12 string >\0
>>>12 use riff-walk
+# Update: Joerg Jenderek
+# lower case for Corel Draw version 8 Bidi
+>8 string/c cdr
+# skip Corel CCX Clipart
+>>8 string !CDRXcont
# Corel Draw Picture
->8 string CDRA \b, Corel Draw Picture
-!:mime image/x-coreldraw
->8 string CDR6 \b, Corel Draw Picture, version 6
-!:mime image/x-coreldraw
+>>>0 use corel-draw
+# URL: http://fileformats.archiveteam.org/wiki/CCX_(Corel)
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/ccx-corel.trid.xml
+>>8 string =CDRXcont \b, Corel Clipart
+!:mime application/x-corel-ccx
+!:ext ccx
+# 3rd chunk data {Corel\040Binary\040Meta\040File}
+#>>>20 string x \b, 3rd '%-s'
+>>>4 ulelong+8 x \b, %u bytes
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/CorelDRAW
+# Reference: http://fileformats.archiveteam.org/wiki/CorelDRAW
+# Picture templates created by newer software start with RIFF type CDT
+>8 string CDT
+>>0 use corel-draw
+# Picture templates with version 4.4
+>8 string CDST
+>>0 use corel-draw
+# pattern created by newer software start with RIFF type PAT
+>8 string PAT
+>>0 use corel-draw
>8 string NUNDROOT \b, Steinberg CuBase
# AVI == Audio Video Interleave
>8 string AVI\040 \b, AVI
@@ -255,7 +277,87 @@
>8 string WEBP \b, Web/P image
!:mime image/webp
>>12 use riff-walk
-
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/CorelDRAW
+# Reference: http://fileformats.archiveteam.org/wiki/CorelDRAW
+# Note: Since version 3 CorelDraw Pictures are RIFF based
+# but data chunks remain proprietary.
+# Since version 14 til 15 packed as "content/riffData.cdr" and
+# since 16 "content/root.dat" in ZIP container
+# TODO: distinguish templates with version 12.5 from Designer illustration 12
+# display information of RIFF based Corel Draw pictures, templates and patterns
+0 name corel-draw
+# display second chunk for debugging
+#>8 string x \b, [8]=%.8s
+>0 string x \b, Corel Draw
+#!:mime image/x-coreldraw
+!:mime application/vnd.corel-draw
+# used by newer pictures templates
+>>8 string CDT
+# used by templates with newer versions since 16
+>>>12 string =fver Picture template (root.dat)
+!:ext dat
+# used by templates with older versions with vrsn tag
+>>>12 string !fver
+# used by templates with older versions 14-15
+>>>>11 string >E Picture template (riffData.cdr)
+!:ext cdr
+# used by templates with older versions 11-13
+>>>>11 string <F Picture template
+!:ext cdt/cdrt
+# used by older templates with version 4.4
+>>8 string CDST Picture template
+!:ext cdt
+# used by templates with version 12.5
+>>8 string DESC Picture template
+!:ext cdt
+# used by newer patterns with version 22
+>>8 string PAT Pattern
+!:ext dat
+# remaining older templates, patterns, drawings
+>>8 default x
+# pattern with old version 4.y
+>>>26 ulelong =0x0000206C Pattern
+!:ext pat
+# pattern with newer versions
+>>>26 ulelong =0x00000D2C Pattern
+!:ext pat
+# remaining older templates or pictures
+>>>26 default x
+# used by older versions 5 - 15
+>>>>12 string =vrsn
+# 4th chunk size unequal 282Ch only found for CDR
+>>>>>26 ulelong !0x0000282c Picture
+!:ext cdr
+>>>>>26 default x Picture or template
+!:ext cdr/cdt
+# used by newer versions since 16
+>>>>12 string =fver Picture (root.dat)
+!:ext dat
+# version marked by 1 ASCII char: space~3, ... , F~15, ... , N~22, ... R~22 template
+>11 string x \b, version
+>11 string >\040 '%-.1s'
+>0 use corel-version
+>4 ulelong+8 x \b, %u bytes
+#
+# display numeric version of RIFF based Corel after 3rd RIFF tag
+0 name corel-version
+# for debugging purpose; vrsn for short content; fver for 16 byte size
+#>12 string x \b, TAG "%-4.4s"
+# 1st data chunk length 2 implies short content version
+>16 ulelong 2
+# vrsn chunk short content interpreted by MajorVersion * 100 + MinorVersion
+>>20 uleshort/100 x %u
+>>20 uleshort%100 >0 \b.%u
+# for debugging purpose display next chunk like: DISP LIST
+#>>22 string x \b, 4th "%-4.4s"
+#>>26 ulelong x \b, 4th SIZE 0x%x
+# for debugging purpose display 5th chunk like: LIST DISP ccmm osfp
+#>>(26.l+30) string x \b, 5th "%-4.4s"
+# 1st data chunk length 10h implies 16 byte content with version info
+>16 ulelong 0x10
+>>34 ubyte x %u
+>>>33 ubyte >0 \b.%u
#
# XXX - some of the below may only appear in little-endian form.
#
@@ -292,9 +394,12 @@
>>22 beshort =2 \b, stereo
>>22 beshort >2 \b, %d channels
>>24 belong >0 %d Hz
-# Corel Draw Picture
->8 string CDRA \b, Corel Draw Picture
->8 string CDR6 \b, Corel Draw Picture, version 6
+# Corel Draw Picture big endian not tested by real examples
+#>8 string CDRA \b, Corel Draw Picture
+#>8 string CDR6 \b, Corel Draw Picture, version 6
+>8 string CDR
+>>0 use \^corel-draw
+
# AVI == Audio Video Interleave
>8 string AVI\040 \b, AVI
# Animated Cursor format