Thumbnails

This forum is aimed at user contributions, in the form of assets, side projects, code patches and similar.

Moderator: joepal

Thumbnails

Postby cousteau » Mon Jan 25, 2010 7:44 pm

I don't like the idea of having a separate file for the model and the thumbnail. Normally, programs save results as single files or, in some cases, as project folders (which is pointless for just 2 files).

Solution 1: Concatenate the thumbnail and the text file on a single file. This way, any image viewer/thumbnailer that doesn't mind a png/jpg/bmp file having a .mhm extension would display it without problems. The MakeHuman content could be gzipped to reduce the file size.
The problem: How to tell MakeHuman the data offset? (i.e. where the mhm text file starts) - maybe with a comment on the PNG or something like that?

Solution 2: The PNG specification includes a iTXt tag that can hold text, compressed or not, but I'm not sure how this works.
Problems are: a) This would be a MakeHuman file inside an image file, rather than an image file inside a MH file, and b) MakeHuman would have to parse and edit a PNG

Solution 3: A .zip or .tar.gz file renamed as .mhm (or .mhz?), containing the MakeHuman source, the thumbnail, and maybe some additional files (textures, libraries, render results, more humans, and whatever we could need in the future). This is a good idea since it would make MakeHuman extensible. The python libraries zipfile and tarfile would help here.
Problem: It isn't an image format recognized by common image viewers.

Solution 4: Write MakeHuman files in an XML format and then append a svg image to them (which are also in XML format). Use gzip or something to compress it.
Example:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<svg>
  ...
</svg>

<mh:makehuman version="1.0.0" name="test001">
  <mh:model name="Human 1">
    <mh:gender value="0.50"/>
    <mh:age value="0.50"/>
    <mh:muscle value="0.50"/>
    <mh:weight value="0.50"/>
    <mh:ethnic>
      <mh:attr name="neutral" value="1.00"/>
    </mh:ethnic>
    <mh:details>
      <mh:attr name="pelvis_overweight" value="0.15"/>
      <mh:attr name="l-upperarm_muscle" value="0.23"/>
    </mh:details>
  </mh:model>
</mh:makehuman>
Problems: a) Now we need an XML parser/editor; b) Hard to make backwards compatible; c) How the hell do you convert a bitmap to a svg?

I like the 3rd solution (+ a thumbnailer in case you feel that thumbnails are useful on a file browser). The XML idea on the 4th could be useful since XML provides higher-level features and is very extended.


By the way, PNG>BMP (transparency support, lossless compression...)
cousteau
 
Posts: 32
Joined: Mon Jan 11, 2010 11:44 am

Re: Thumbnails

Postby mflerackers » Tue Jan 26, 2010 2:13 am

It's bmp because SDL has a built in BMP writer and not PNG or anything else, and we don't like adding more dependencies.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto


Return to User contributions

Who is online

Users browsing this forum: No registered users and 1 guest