Another MC-Rev anomaly: "text of image" property
Wilhelm Sanke
sanke at hrz.uni-kassel.de
Wed Nov 1 11:18:44 CST 2006
On Tue, 31 Oct 2006, J. Landman Gay wrote:
> Wilhelm Sanke wrote:
> <snip>
>
> For the above points there are no differences between Rev and MC, but
> - The format of the "text of image" property is different in Rev
> and MC - tested both in stacks and standalones.
>
> Rev sets the default paintCompression to PNG and MC sets it to RLE. I
> suspect this is done in the RevCommon library, but I haven't actually
> looked. To test equivalencies, it would be good if you set the the
> paintCompression to PNG in MC too.
Thanks, Jacqueline, this was the most important hint for me in the last
weeks, because it also solves the mystery of the slow imagedata handling
in Rev, which we dicussed at length in thread "MC-Rev speed differences.."
A related problem and also involving "paintcompression" had been
dicussed between Dar Scott and Wouter in January 2004.---
The format of paintcompression affects both properties "text of image"
and "imagedata".
How the properties are affected seems to be a can of worms and the Rev
docs are incomplete/ambiguous here and even wrong for some details:
Rev docs: "By default, the global paintcompression property is set to
"rle" in standalones and "png" in the development environment."
This is not true: By default, in Rev paintcompression is set to PNG in
the environment *and* standalones. If this would not be the case then
we would not get the speed differences in imagedata handling between
Metacard and Revolution.
Rev docs: "If the image was created with the import command, its
paintcompression is set to the format of the imported picture file."
This is only true if the image was fully imported. For a "referenced"
image the paintcompression format is that of the environment, PNG for
Rev and RLE ("Windows run-length encoded") for Metacard, and - a
referenced image does not contain any "text of image" data, but contains
"imagedata". A referenced image will acquire "text of image" data only
after you have edited it.
Rev docs: "To change an image's compression format, first set the
paintcompression to the desired value, then paint in the image. Then
either go to another card and return, or close and re-open the stack."
This is only partially true: Besides painting in the image you can apply
other possibilities of editing like changing the imagedata with filters
etc. Also it is not necessary to go to another card and return.
The short entry 707 of the Metacard docs is more precise here:
"This property sets the compression format used when an image is
recompressed after it has been edited."---
When you get the "text of image" data while paintcompression if set to
RLE (and the image had been edited), resetting the image to its own
"text of image" data will make it totally transparent as all chars of
its alphadata are set to 0. I suppose this is a bug, as I cannot see a
sound reason for this transparency.
Resetting the alphadata of the transparent image to 255 will not reset
the image, but produce a monochrome rectangle.
The "text of image" data can be retrieved and reset with the other
paintcompression formats PNG, JPEG, and GIF.
If the paintcompression is set to GIF (and the image had been edited)
and you restore an image with "imagedata" retrieved with
paintcompression set to RLE or PNG the resulting image may be distorted
or incomplete.
For my imagedata-handling stacks "Seamless Tiles" and "Imagedata
Toolkit" I added an open-stack handler with "set the paintcompression to
RLE". The described and discussed speed differences between MC and Rev
are no longer there.
At least one question remains, where is the default paintcompression
set? I made a script search in the MC home and tools stacks and did not
find "paintcompression"?? -
I have added a comment to my Bugzilla entry 3938 stating that the issue
has been resolved.
Best regards,
Wilhelm Sanke
<http://www.sanke.org/MetaMedia>
More information about the metacard
mailing list