Skip to content

Commit 4db407d

Browse files
authored
Add support for OpenDocument graphics and templates (#718)
1 parent 1fe621a commit 4db407d

9 files changed

+46
-1
lines changed

core.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,41 @@ function getFileTypeFromMimeType(mimeType) {
3939
ext: 'odt',
4040
mime: 'application/vnd.oasis.opendocument.text',
4141
};
42+
case 'application/vnd.oasis.opendocument.text-template':
43+
return {
44+
ext: 'ott',
45+
mime: 'application/vnd.oasis.opendocument.text-template',
46+
};
4247
case 'application/vnd.oasis.opendocument.spreadsheet':
4348
return {
4449
ext: 'ods',
4550
mime: 'application/vnd.oasis.opendocument.spreadsheet',
4651
};
52+
case 'application/vnd.oasis.opendocument.spreadsheet-template':
53+
return {
54+
ext: 'ots',
55+
mime: 'application/vnd.oasis.opendocument.spreadsheet-template',
56+
};
4757
case 'application/vnd.oasis.opendocument.presentation':
4858
return {
4959
ext: 'odp',
5060
mime: 'application/vnd.oasis.opendocument.presentation',
5161
};
62+
case 'application/vnd.oasis.opendocument.presentation-template':
63+
return {
64+
ext: 'otp',
65+
mime: 'application/vnd.oasis.opendocument.presentation-template',
66+
};
67+
case 'application/vnd.oasis.opendocument.graphics':
68+
return {
69+
ext: 'odg',
70+
mime: 'application/vnd.oasis.opendocument.graphics',
71+
};
72+
case 'application/vnd.oasis.opendocument.graphics-template':
73+
return {
74+
ext: 'otg',
75+
mime: 'application/vnd.oasis.opendocument.graphics-template',
76+
};
5277
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
5378
return {
5479
ext: 'xlsx',

fixture/fixture.odg

7.8 KB
Binary file not shown.

fixture/fixture.otg

7.81 KB
Binary file not shown.

fixture/fixture.otp

14.1 KB
Binary file not shown.

fixture/fixture.ots

7.09 KB
Binary file not shown.

fixture/fixture.ott

8.07 KB
Binary file not shown.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,12 @@
223223
"potx",
224224
"xltx",
225225
"dotx",
226-
"xltm"
226+
"xltm",
227+
"ots",
228+
"odg",
229+
"otg",
230+
"otp",
231+
"ott"
227232
],
228233
"dependencies": {
229234
"@tokenizer/inflate": "^0.2.6",

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
514514
- [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format) - Material Exchange Format
515515
- [`nef`](https://www.nikonusa.com/en/learn-and-explore/a/products-and-innovation/nikon-electronic-format-nef.html) - Nikon Electronic Format image file
516516
- [`nes`](https://fileinfo.com/extension/nes) - Nintendo NES ROM
517+
- [`odg`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for drawing
517518
- [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations
518519
- [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets
519520
- [`odt`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for word processing
@@ -525,6 +526,10 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
525526
- [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format)) - Audio file
526527
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
527528
- [`otf`](https://en.wikipedia.org/wiki/OpenType) - OpenType font
529+
- [`otg`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for drawing
530+
- [`otp`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for presentations
531+
- [`ots`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for spreadsheets
532+
- [`ott`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for word processing
528533
- [`parquet`](https://en.wikipedia.org/wiki/Apache_Parquet) - Apache Parquet
529534
- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
530535
- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format

supported.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ export const extensions = [
160160
'xltx',
161161
'dotx',
162162
'xltm',
163+
'ott',
164+
'ots',
165+
'otp',
166+
'odg',
167+
'otg',
163168
];
164169

165170
export const mimeTypes = [
@@ -319,4 +324,9 @@ export const mimeTypes = [
319324
'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
320325
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
321326
'application/vnd.ms-excel.template.macroenabled.12',
327+
'application/vnd.oasis.opendocument.text-template',
328+
'application/vnd.oasis.opendocument.spreadsheet-template',
329+
'application/vnd.oasis.opendocument.presentation-template',
330+
'application/vnd.oasis.opendocument.graphics',
331+
'application/vnd.oasis.opendocument.graphics-template',
322332
];

0 commit comments

Comments
 (0)