LDraw.org Discussion Forums
OMR + TEXMAPped unofficial file = ??? - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: General (https://forums.ldraw.org/forum-12.html)
+--- Forum: Official File Specifications/Standards (https://forums.ldraw.org/forum-32.html)
+--- Thread: OMR + TEXMAPped unofficial file = ??? (/thread-18493.html)

Pages: 1 2 3 4


OMR + TEXMAPped unofficial file = ??? - Philippe Hurbain - 2016-01-02

OMR specification requires to include unofficial files (a very good thing!), but what to do when this unofficial part contains TEXMAP images? Can we imagine a way to include these images in MPD? How to make this compatible with applications that support TEXMAP (afaik LDView, LDCad, LeoCAD and Bricksmith)?

And a 2016 good new year's resolution: have TEXMAP images on Parts Tracker !


Re: OMR + TEXMAPped unofficial file = ??? - Michael Heidemann - 2016-01-02

This is a very good question.

At present I only can think about a file entry for the picture also! I think that the spec for MPD files already allows this. The only problem we need to solve is that the reader apps needs to be aware of that and can handle it.

just my 5 cent


Re: OMR + TEXMAPped unofficial file = ??? - Chris Dee - 2016-01-02

Yes, one of my aims too.


Re: OMR + TEXMAPped unofficial file = ??? - Roland Melkert - 2016-01-02

Michael Heidemann Wrote:At present I only can think about a file entry for the picture also! I think that the spec for MPD files already allows this. The only problem we need to solve is that the reader apps needs to be aware of that and can handle it.
This would need multiple things...

1. Binairy encoding (in order to keep the mpd text based)
2. A new meta to encapsulate said data in one or multiple lines (e.g. 0 !BINDATA FJSJ2321ssdKSKL3LKdDLJSLsdaKFDJL3432LKJ21LJLSJLD.............)
3. A new mpd '0 FILE' variant to identify the subfile as a texture (e.g. 0 !BINFILE TEXMAP image.png)
4. Adjustment to the texture image lookup rules.

All this means it won't work in existing texmap supporting programs out of the box, but it won't break existing mpd support ether.


Re: OMR + TEXMAPped unofficial file = ??? - Steffen - 2016-01-03

a solution for embedding images into MPDs could be to use the Data URI scheme:
https://en.wikipedia.org/wiki/Data_URI_scheme
This has the advantage of
- it provides a MIME type
- it allows to use charset UTF-8
- it is text-based
- it is an already established standard (we don't have to re-invent the wheel)

For example, a small image of a red dot could be represented inside an MPD like this:
Code:
0 FILE reddot.png
0 red dot
0 Name: reddot.png
0 Author: Wikipedia
0 !DATA data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==



Re: OMR + TEXMAPped unofficial file = ??? - Michael Heidemann - 2016-01-03

That sounds good. But why do we need the line "Name: xxxx" and also the line above?

If the line "0 File xxxxx" contain a name with the extension ".png" then it has to be a picture with that name!

We should keep it as simple as possible.


Re: OMR + TEXMAPped unofficial file = ??? - Steffen - 2016-01-03

Yes, of course. The example above results from saving a dummy MPD file with MLCad and then just adding the !DATA line.


Re: OMR + TEXMAPped unofficial file = ??? - Michael Heidemann - 2016-01-03

Please add a simple file with picture to this thread that make use of TEXMAP. So we are able to let our thoughts flow Smile


Re: OMR + TEXMAPped unofficial file = ??? - Philippe Hurbain - 2016-01-03

Exemple of a TEXMAPped part: http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/13710a.dat
Texture file attached here
[attachment=1926]


Re: OMR + TEXMAPped unofficial file = ??? - Michael Heidemann - 2016-01-03

Thank you.

Now I need to find a way to transform the picture in Visual Basic Smile
Got it!

The DATA according to Firefox is like follows:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlsAAAEFCAYAAADUqSJrAAAgAElEQVR4nOydd3CbVbr/c3937sydO3fuX3tnduYSYAGnhxBKElpCCQkJsIQaOlkgENgQCKEmWUIglARCKIHNEkKsYtmyLNlqli2523LvluTee3vVe/n+/nhjxYokW7Ily07OZ+aZBenV+57zSvj97DnPec4iEAiEsLDb7dBoNMiUZ4CTmIB4xnnEM86DxWZCKEpDkbIQmkYNRkZG4HK5Yt1cAoFAIMSYRbFuAIGwUPB4PGhQNSCBw.......

Sadly the code is too long for the forum.