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 5


Re: OMR + TEXMAPped unofficial file = ??? - Roland Melkert - 2016-03-17

I think Steffen's example:

Code:
0 FILE reddot.png
0 red dot
0 Name: reddot.png
0 Author: Wikipedia
0 !DATA data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==

Is very usable/implementable. It just needs some global rules. Like, e.g.:

"when a !DATA is used in all other lines except header descriptive ones most be ignored."
"Only the image/png;base64 variant is supported."

and maybe limit the file extension, but I don't think that is actually needed as the texture can be detected by the presence of the data meta alone.


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

- yes, we should require these restrictions
- I suggest to also allow image/jpg and image/jpeg (which mean the same)
- to avoid that all users are forced to just use 1 (potentially very long) line, we could allow that that line is splitup into multiple ones, each starting with !DATA


RE: OMR + TEXMAPped unofficial file = ??? - Reuben Pearse - 2016-08-17

(2016-01-05, 8:09)Philippe Hurbain Wrote: I dream of somebody improving on Travis SvgToDat converter...

Where can I find details of the SvgToDat converter? The link on this post comes up with the message "The specified thread does not exist."


RE: OMR + TEXMAPped unofficial file = ??? - Travis Cobbs - 2016-08-18

(2016-08-17, 17:11)Reuben Pearse Wrote:
(2016-01-05, 8:09)Philippe Hurbain Wrote: I dream of somebody improving on Travis SvgToDat converter...

Where can I find details of the SvgToDat converter? The link on this post comes up with the message "The specified thread does not exist."

Here is the original post where I published my first test build (which is the only one ever) of the program:

http://forums.ldraw.org/thread-593-post-720.html#pid720

That was almost exactly 5 years ago. I'd be happy to publish the source code if anyone is interested in taking it further. The download link in that post is still valid, but you need to read the post before trying it out.


RE: OMR + TEXMAPped unofficial file = ??? - Travis Cobbs - 2018-01-05

Reviving this thread, I have some suggested modifications. I don't think we should make this MPD-specific. Instead, I think we should add a new !DATA meta that requires a filename prior to the base64-encoded data. The decoded contents of the base64 data would then be treated as the specified file. (In theory, an ldr file could even be encoded and then referenced, but this would be strongly discouraged.)

Also, I think we should conform to e-mail-compatible base64 encoding, meaning that we should only have 76 encoded characters per line. Each line would begin with "0 !:" (like used in !TEXMAP itself). Something like:

Code:
0 !DATA BEGIN 19204p01.png
0 !:iVBORw0KGgoAAAANSUhEUgAAAbcAAAHfCAYAAADTMJbcAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
0 !:BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG
0 !:AADzUElEQVR42uz9a49tSZIdiC3bJ+JmVbM13WSzX2Q1KY4AUcIMJM1QA4wA/WF91W8QIAEDDqWR
0 !:hhwNpKHIqmZ3VbPJ5qMr80bEOaYP2x/m7vbakTez7s10L2TFjYgT57EfbraWma1FzIy99tprr732
0 !DATA END

(Note that I only included the first 4 lines of the base64-encoded version of 19204p01.png.)

It would be illegal to have a !DATA statement between a !TEXMAP BEGIN and !TEXMAP END, or immediately following a !TEXMAP NEXT.


RE: OMR + TEXMAPped unofficial file = ??? - Roland Melkert - 2018-01-05

(2018-01-05, 20:54)Travis Cobbs Wrote: Reviving this thread, I have some suggested modifications. I don't think we should make this MPD-specific. Instead, I think we should add a new !DATA meta that requires a filename prior to the base64-encoded data. The decoded contents of the base64 data would then be treated as the specified file. (In theory, an ldr file could even be encoded and then referenced, but this would be strongly discouraged.)

Also, I think we should conform to e-mail-compatible base64 encoding, meaning that we should only have 76 encoded characters per line. Each line would begin with "0 !:" (like used in !TEXMAP itself). Something like:

Code:
0 !DATA BEGIN 19204p01.png
0 !:iVBORw0KGgoAAAANSUhEUgAAAbcAAAHfCAYAAADTMJbcAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
0 !:BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG
0 !:AADzUElEQVR42uz9a49tSZIdiC3bJ+JmVbM13WSzX2Q1KY4AUcIMJM1QA4wA/WF91W8QIAEDDqWR
0 !:hhwNpKHIqmZ3VbPJ5qMr80bEOaYP2x/m7vbakTez7s10L2TFjYgT57EfbraWma1FzIy99tprr732
0 !DATA END

(Note that I only included the first 4 lines of the base64-encoded version of 19204p01.png.)

It would be illegal to have a !DATA statement between a !TEXMAP BEGIN and !TEXMAP END, or immediately following a !TEXMAP NEXT.

I like the format but I still think an embedded png (or any non ldraw file) should have its own FILE section as it can be referenced from multiple models/parts.

So maybe
Code:
0 FILE 19204p01.png
0 Texture for 19204p01
0 Name: 19204p01.png
0 Author: Philippe Hurbain [Philo]
0 !LDRAW_ORG Texture UPDATE 2018-01
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 !DATA BEGIN
0 !:iVBORw0KGgoAAAANSUhEUgAAAbcAAAHfCAYAAADTMJbcAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
0 !:BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG
0 !:AADzUElEQVR42uz9a49tSZIdiC3bJ+JmVbM13WSzX2Q1KY4AUcIMJM1QA4wA/WF91W8QIAEDDqWR
0 !:hhwNpKHIqmZ3VbPJ5qMr80bEOaYP2x/m7vbakTez7s10L2TFjYgT57EfbraWma1FzIy99tprr732
0 !DATA END



RE: OMR + TEXMAPped unofficial file = ??? - Philippe Hurbain - 2018-01-07

I like the proposal. I tested an mpd with an embedded image with MLCad, LDCad, MPDCenter, MPDwizard. Of course the texture didn't work, but I got no weird behaviour. Only minor drawback: if I extract mpd files, a .png is created while the file with header and uuencoded content is NOT a png file.


RE: OMR + TEXMAPped unofficial file = ??? - Roland Melkert - 2018-01-07

(2018-01-07, 15:25)Philippe Hurbain Wrote: I like the proposal. I tested an mpd with an embedded image with MLCad, LDCad, MPDCenter, MPDwizard. Of course the texture didn't work, but I got no weird behaviour. Only minor drawback: if I extract mpd files, a .png is created while the file with header and uuencoded content is NOT a png file.

I expect most programs would see it as an empty model, unless they restrict the extensions for some reason.

I'm not sure about the file type specification though, using
Code:
0 !LDRAW_ORG Texture UPDATE 2018-01

Might be to restrictive as we would have to add keys for all filetypes, maybe a more generic :
Code:
0 !LDRAW_ORG Data UPDATE 2018-01
Combined with the program interpreting the file extension given in FILE or the filename itself would be enough.

You could also use, e.g.:
Code:
0 unofficial data
in mpd's etc.

Probably its only use, as official libraries should distribute the png as is, although this setup would allow for an png to be wrapped by a non .mpd .ldr named .png Smile


RE: OMR + TEXMAPped unofficial file = ??? - Michael Horvath - 2018-01-07

(2018-01-05, 20:54)Travis Cobbs Wrote: Reviving this thread, I have some suggested modifications. I don't think we should make this MPD-specific. Instead, I think we should add a new !DATA meta that requires a filename prior to the base64-encoded data. The decoded contents of the base64 data would then be treated as the specified file. (In theory, an ldr file could even be encoded and then referenced, but this would be strongly discouraged.)

Also, I think we should conform to e-mail-compatible base64 encoding, meaning that we should only have 76 encoded characters per line. Each line would begin with "0 !:" (like used in !TEXMAP itself). Something like:

Code:
0 !DATA BEGIN 19204p01.png
0 !:iVBORw0KGgoAAAANSUhEUgAAAbcAAAHfCAYAAADTMJbcAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
0 !:BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG
0 !:AADzUElEQVR42uz9a49tSZIdiC3bJ+JmVbM13WSzX2Q1KY4AUcIMJM1QA4wA/WF91W8QIAEDDqWR
0 !:hhwNpKHIqmZ3VbPJ5qMr80bEOaYP2x/m7vbakTez7s10L2TFjYgT57EfbraWma1FzIy99tprr732
0 !DATA END

(Note that I only included the first 4 lines of the base64-encoded version of 19204p01.png.)

It would be illegal to have a !DATA statement between a !TEXMAP BEGIN and !TEXMAP END, or immediately following a !TEXMAP NEXT.

Splitting to multiple lines will cause the user to have to scroll by huge amounts in programs that show the LDR source code. Is MLCAD the only program that still does this?


RE: OMR + TEXMAPped unofficial file = ??? - Travis Cobbs - 2018-01-08

(2018-01-07, 19:39)Michael Horvath Wrote: Splitting to multiple lines will cause the user to have to scroll by huge amounts in programs that show the LDR source code. Is MLCAD the only program that still does this?

I think not splitting to multiple lines is just asking for trouble. Many text editors are likely to be unhappy with 250,000-byte lines.