ZIP-compressed XML-based file formats

Reported bugs that have been closed and/or resolved

Moderators: XnTriq, helmut, xnview, Dreamer

User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

ZIP-compressed XML-based file formats

Post by XnTriq »

m.Th. wrote:
These are basically ZIP archives with a .craft filename extension and an internal sctructure similar to that of Office Open XML (including an embedded JPEG preview thumbnail).
So, XnView can already see these files. The code was added when we did support the MS Office / OpenOffice etc. Just add the .craft format to the list.
:o This has already been implemented?
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Conversion of files

Post by m.Th. »

Yep. It was implemented. :)

See the screenshot below: Word, Excel, PowerPoint, InDesign :D
Office file formats.jpg
I think that we worked it out for OpenOffice also but I don't have time now to generate some thumbs.

IIRC the thread where we worked on this feature was this one: viewtopic.php?t=29699

So the code exists, just that it needs to be enabled for various file extensions - no big deal, but it must be done.

XnTriq wrote:
m.Th. wrote:
These are basically ZIP archives with a .craft filename extension and an internal sctructure similar to that of Office Open XML (including an embedded JPEG preview thumbnail).
So, XnView can already see these files. The code was added when we did support the MS Office / OpenOffice etc. Just add the .craft format to the list.
:o This has already been implemented?
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Conversion of files

Post by XnTriq »

m.Th. wrote:Yep. It was implemented. :)

See the screenshot below: Word, Excel, PowerPoint, InDesign :D

Image

I think that we worked it out for OpenOffice also but I don't have time now to generate some thumbs.

IIRC the thread where we worked on this feature was this one: viewtopic.php?t=29699

So the code exists, just that it needs to be enabled for various file extensions - no big deal, but it must be done.
I can't find any mention of this feature in the change log :-? Are you sure that these thumbnails aren't generated by (a) 3rd-party shell thumbnail handler extension(s) installed on your system?
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Conversion of files

Post by m.Th. »

Are you sure that these thumbnails aren't generated by (a) 3rd-party shell thumbnail handler extension(s) installed on your system?
Well, I certainly remember when I worked with Pierre in implementing this and when I spoke with the guys from Adobe about InDesign's internal format layout. (I remember also that I spoke with the guys from Quark but this is another story...)

Also, I have the latest version of Autodesk Inventor fully installed on my system and the files are shown in Windows Explorer's preview pane in their full glory. From the pixelation induced by "JPEG effect" is clear that these are prerendered thumbs/previews stored in files because Inventor is a full 3D parametric modeller. Also in Inventor's File Save Options there is a checkbox "Save Preview Picture" with some options. However this preview picture cannot be seen in XnView MP. Incidentally the files are a variant of Office Open XML (the format in this thread).

Also I have Corel Draw files on my computer but I uninstalled Corel Draw. Windows Explorer sees them but XnView MP cannot anymore.

Note: To implement the thumb for Inventor is very easy (just few lines of code) but it needs their SDK (fully and freely available) - I can provide samples if you want - while with Corel is a piece of cake (reuse the Open Office XML engine).

Also, you can see it for yourself. Go to Settings | General | General and enable "Show all graphic formats" (My God, why this option isn't enabled by default ???) and after that have look at a directory with docx, xlsx, pptx and indd files - samples available. :)
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Conversion of files

Post by XnTriq »

Thanks for taking the time to elaborate, m.Th. :-)

@Pierre: Please add these…

Code: Select all

┌────────────────────────────────────────┬──────┬───────┬───────────┐
│ Description                            │ Read │ Write │ Extension │
├────────────────────────────────────────┼──────┼───────┼───────────┤
│ Office Open XML Document (preview)     │  •   │       │ docx/docm │
│ Office Open XML Workbook (preview)     │  •   │       │ xlsx/xlsm │
│ Office Open XML Presentation (preview) │  •   │       │ pptx/pptm │
│ Adobe InDesign Document (preview)      │  •   │       │ indd/indt │
└────────────────────────────────────────┴──────┴───────┴───────────┘
… to the list of supported formats.
InDesign User Guide (Work with files and templates → [url=http://helpx.adobe.com/indesign/using/files-templates.html#open_indesign_documents]Open InDesign documents[/url]) wrote:In general, you open document and template files the same way you do in other programs. When you open an InDesign template, it opens as a new, untitled document by default. Document files use the extension .indd, template files use the extension .indt, snippet files use the extension .idms, library files use the extension .indl, interchange files use the extension .inx, markup files use the extension .idml, and book files use the extension .indb.

You can also use the File > Open command to open files from earlier versions of InDesign, InDesign Interchange (.inx) files, InDesign Markup (.idml) files, Adobe PageMaker 6.0 and later, QuarkXPress 3.3 and 4.1, and QuarkXPress Passport 4.1 files. In addition, other software vendors may make plug‑in software that lets you open other file formats.
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Conversion of files

Post by m.Th. »

To implement the thumb for Inventor is very easy (just few lines of code) but it needs their SDK (fully and freely available)


Nevermind. Cracked: viewtopic.php?f=60&t=37030&p=148234#p148234

----------------------------------------------------------------------
@Pierre: Please add these…
Also add to the same list the .blend files which have already the same preview/thumbnail support - the Blender is the biggest open source direct 3D modeller / renderer/ animator (https://www.blender.org/) most probably you know it.

You can generate now a thumb for a .blend file to see.

Your sample is here: https://drive.google.com/file/d/1OMh77g ... sp=sharing
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Conversion of files

Post by xnview »

XnTriq wrote:Thanks for taking the time to elaborate, m.Th. :-)

@Pierre: Please add these…

Code: Select all

┌────────────────────────────────────────┬──────┬───────┬───────────┐
│ Description                            │ Read │ Write │ Extension │
├────────────────────────────────────────┼──────┼───────┼───────────┤
│ Office Open XML Document (preview)     │  •   │       │ docx/docm │
│ Office Open XML Workbook (preview)     │  •   │       │ xlsx/xlsm │
│ Office Open XML Presentation (preview) │  •   │       │ pptx/pptm │
│ Adobe InDesign Document (preview)      │  •   │       │ indd/indt │
└────────────────────────────────────────┴──────┴───────┴───────────┘
… to the list of supported formats.
Why? i don't support it
Pierre.
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Conversion of files

Post by m.Th. »

xnview wrote:
XnTriq wrote:Thanks for taking the time to elaborate, m.Th. :-)

@Pierre: Please add these…

Code: Select all

┌────────────────────────────────────────┬──────┬───────┬───────────┐
│ Description                            │ Read │ Write │ Extension │
├────────────────────────────────────────┼──────┼───────┼───────────┤
│ Office Open XML Document (preview)     │  •   │       │ docx/docm │
│ Office Open XML Workbook (preview)     │  •   │       │ xlsx/xlsm │
│ Office Open XML Presentation (preview) │  •   │       │ pptx/pptm │
│ Adobe InDesign Document (preview)      │  •   │       │ indd/indt │
└────────────────────────────────────────┴──────┴───────┴───────────┘
… to the list of supported formats.
Why? i don't support it
...if you say so, then this is

BAD!

The support is very simple (basically you need to extract a PNG or BMP file from a zip file, that's all - see here for details) and as you saw in the links from this thread (and elsewhere) it has a big impact. You will solve a lot of requests in this way.
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Conversion of files

Post by XnTriq »

m.Th. wrote:Also add to the same list the .blend files which have already the same preview/thumbnail support - the Blender is the biggest open source direct 3D modeller / renderer/ animator (https://www.blender.org/) most probably you know it.
You can generate now a thumb for a .blend file to see.

Your sample is here: https://drive.google.com/file/d/1OMh77g ... sp=sharing
OK, I can confirm that previewing of .blend (Blender 3D Model) and .indd (Adobe InDesign Document) is already possible if there are thumbnails embedded in the files.
XnTriq wrote:
m.Th. wrote:Yep. It was implemented. :)

See the screenshot below: Word, Excel, PowerPoint, InDesign :D

Image

I think that we worked it out for OpenOffice also but I don't have time now to generate some thumbs.

IIRC the thread where we worked on this feature was this one: viewtopic.php?t=29699

So the code exists, just that it needs to be enabled for various file extensions - no big deal, but it must be done.
I can't find any mention of this feature in the change log :-? Are you sure that these thumbnails aren't generated by (a) 3rd-party shell thumbnail handler extension(s) installed on your system?
Do you know where MP gets the thumbnails for MS Office from on your system, m.Th.?
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Office Open XML and related file formats

Post by m.Th. »

Do you know where MP gets the thumbnails for MS Office from on your system, m.Th.?
...now I do... UNFORTUNATELY.

I put XnView MP in a fresh server OS install with the samples. UNFORTUNATELY (again) Pierre is right. No thumbs are generated.

Sigh!

What puzzles me is that:


1. It is very easy to implement it.

2. Very strong selling point: we will support by far the most well known file formats

3. Almost all new formats of the big names in software are (in our discussion) like this: a zip file with a thumbnail in it. The name of the thumbnail file and its format can vary (also it can have a small header in front) but basically is the same principle. Nobody will write from scratch a new format when such advanced storage frameworks exist.

4. We can differentiate from others. On the market of image formats the things are pretty mature: JPEG, PNG, TIFF - that's the bulk. Raw formats are a different category but also these are pretty mature: CR2, NEF, PEF, ARW... Perhaps a GIF here and there, a PSD... There are a gazillion of viewers for these. We need to enter in other huge markets: office, DTP, 3D modelling. And it is easy to do it.

5. We can avoid the mess from this thread. "It works for me, it doesn't for you...". "It works in this computer, it doesn't work on another...". How many users will have the patience and dedication to debug this mess?

6. We have a ton of requests in these forums which ALL of them can be solved by implementing this. And, of course, I can provide samples for another very popular formats...

EDIT: The same stands for DWG, the native format of AutoCad, by far the most popular format in CAD. Amazing... amazing... amazing...
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Office Open XML and related file formats

Post by xnview »

m.Th. wrote: 1. It is very easy to implement it.
which format use that? OpenOffice ok...
Pierre.
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Office Open XML and related file formats

Post by m.Th. »

xnview wrote:
m.Th. wrote: 1. It is very easy to implement it.
which format use that? OpenOffice ok...
In our discussion: a lot of formats.

Technically precise, we speak about several formats: OLECF, Open Office XML, Office Open XML (yes, there are TWO different and concurrent (!) formats), OpenDocument etc. Yep, it is a mess if we want to enter into details.

...but for us the things are pretty simple, because we want only the thumbnail.

>>>> The short story of all this: (you can skip if you want, but IMHO is better to read)

When the programs and their files become more and more complex the costs with the persistence engines ("save & load") had grown astronomically, not only because of Research & Development involved in building such engines but also in maintaining the compatibility.

Due of the inherent object-oriented nature of the programs there was a desperate need of an abstract persistence subsystem in which the developer can save the RTTI of the objects. Firstly, there was the INI files with their "[section] & name=value" architecture, thing which we have in our config.ini . However, the things grown and it was needed to save multiple streams of data from complex objects but these streams must appear to the user as a single file.

So the idea of a "file system inside of a compressed file" appeared. This idea is at the base of all these formats.

In short, ALL these formats are zip files with different extensions.

Depending of the format, the files inside of the archive have (very) different meanings but - thanks God! - (almost?) all of them have a very-easy-and-quick-to-extract thumbnail readily available in a standard graphic format readily available for Windows Explorer or any other file manager in an another Operating System.

<<< The short story ends

SO, Steps to implement:
------
0. you need a zip library (zlib is perfectly fine) - we have it already.
1. Open the archive (let's say "myWordDoc.docx") and scan for the existence of a file named "preview.emf" (of course, the name varies with the format)
2. If the file from point 2. exits, then extract this file in a memory stream
3. In very rare cases (OLECF formats) you need to skip "some data" (Name=Value properties) and do a simple sequential search for the signature - don't worry, the signature is the PNG standard signature which cannot "happen" before.

...and now you have in your memory stream the thumbnail in a known, standard format (PNG, BMP, JPG or EMF). It is just the extraction of a file from a zip. :)
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Office Open XML and related file formats

Post by XnTriq »

<!--// work in progress //-->

Code: Select all

┌─────────────────────────────────┬─────────────────────────────┬────────────────────────────────────┐
│ Office Open XML Document        │ .docx/.dotx, .docm/.dotm    │ \docProps\thumbnail.emf            │
│ (Microsoft Word 2007)           │                             │ \docProps\thumbnail.wmf            │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Office Open XML Workbook        │ .xlsx/.xltx, .xlsm/.xltm    │ \docProps\thumbnail.jpeg           │
│ (Microsoft Excel 2007)          │                             │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Office Open XML Presentation    │ .pptx/.potx, .pptm/.potm    │ \docProps\thumbnail.jpeg           │
│ (Microsoft PowerPoint 2007)     │                             │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Microsoft Visio 2013 Drawing    │ .vsdx/.vstx, .vsdm/.vstm    │ \docProps\thumbnail.emf            │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Microsoft Visio 2013 Stencil    │ .vssx, .vssm                │ \docProps\thumbnail.emf            │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Master Document    │ .odm                        │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Text               │ .odt/.ott                   │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Spreadsheet        │ .ods/.ots, .fods            │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Presentation       │ .odp/.otp, .fodp            │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Chart              │ .odc/.otc                   │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Graphic/Drawing    │ .odg/.otg, .fodg            │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Image              │ .odi/.oti                   │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Formula            │ .odf/.otf                   │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument HTML Template      │ .oth                        │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Database           │ .odb                        │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ CorelDRAW X4 + X5               │ .cdr/.cdt                   │ \metadata\thumbnails\thumbnail.bmp │
│                                 │                             │ \metadata\thumbnails\page1.bmp     │
│                                 │                             │ \metadata\thumbnails\page2.bmp     │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ CorelDRAW X7                    │ .cdr/.cdt                   │ \previews\thumbnail.png            │
│                                 │                             │ \previews\page1.png                │
│                                 │                             │ \previews\page2.png                │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Autodesk Design Web Format      │ .dwf, .dwfx                 │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Autodesk Inventor / Fusion 360  │ .ipt                        │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Craft Artist Project            │ .craft                      │ \preview.jpg                       │
└─────────────────────────────────┴─────────────────────────────┴────────────────────────────────────┘
Samples
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Office Open XML and related file formats

Post by m.Th. »

Nice :)
Add Visio - vsdx (dunno for macro enabled) - \docProps\thumbnail.emf
XnTriq wrote:<!--// work in progress //-->

Code: Select all

┌─────────────────────────────────┬─────────────────────────────┬────────────────────────────────────┐
│ Office Open XML Document        │ .docx/.dotx, .docm/.dotm    │ \docProps\thumbnail.emf            │
│ (Microsoft Word 2007)           │                             │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Office Open XML Workbook        │ .xlsx/.xltx, .xlsm/.xltm    │ \docProps\thumbnail.emf            │
│ (Microsoft Excel 2007)          │                             │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Office Open XML Presentation    │ .pptx/.potx, .pptm/.potm    │ \docProps\thumbnail.emf            │
│ (Microsoft PowerPoint 2007)     │                             │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Text               │ .odt/.ott                   │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Spreadsheet        │ .ods/.ots, .fods            │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Presentation       │ .odp/.otp, .fodp            │ \Thumbnails\thumbnail.png          │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Graphic/Drawing    │ .odg/.otg, .fodg            │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Image              │ .odi/.oti                   │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Chart              │ .odc/.otc                   │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Formula            │ .odf/.otf                   │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument HTML Template      │ .oth                        │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Master Document    │ .odm                        │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ OpenDocument Database           │ .odb                        │                                    │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ CorelDRAW                       │ .cdr                        │ \previews\thumbnail.png            │
│                                 │                             │ \previews\page1.png                │
│                                 │                             │ \previews\page2.png                │
│                                 │                             │ \metadata\thumbnails\thumbnail.bmp │
│                                 │                             │ \metadata\thumbnails\page1.bmp     │
│                                 │                             │ \metadata\thumbnails\page2.bmp     │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ CorelDRAW Template              │ .cdt                        │ \metadata\thumbnails\thumbnail.bmp │
│                                 │                             │ \metadata\thumbnails\page1.bmp     │
│                                 │                             │ \metadata\thumbnails\page2.bmp     │
├─────────────────────────────────┼─────────────────────────────┼────────────────────────────────────┤
│ Craft Artist Project            │ .craft                      │ \preview.jpg                       │
└─────────────────────────────────┴─────────────────────────────┴────────────────────────────────────┘
Compression: ZIP (Deflate)
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
User avatar
m.Th.
XnThusiast
Posts: 1662
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Office Open XML and related file formats

Post by m.Th. »

Update:

Code: Select all

Autodesk Part File				 .ipt				\[5]Zrxrt4arFafyu34gYa3l3ohgHg  (from PNG signature: "89 50 4E 47 0D 0A")
Autodesk Assembly File			.iam				\[5]Zrxrt4arFafyu34gYa3l3ohgHg  (from PNG signature: "89 50 4E 47 0D 0A")
Autodesk 3D presentation		 .ipn				\[5]Zrxrt4arFafyu34gYa3l3ohgHg  (from PNG signature: "89 50 4E 47 0D 0A")
Autodesk Design Web Format	  .dwf/.dwfx			*.jpg (you must search it recursively)
OpenDocument Graphic/Drawing	.odg/.otg, .fodg    \Thumbnails\thumbnail.png
m. Th.

- Dark Themed XnViewMP 1.6 64bit on Win11 x64 -
Post Reply