Wow, impressive explaination!
As a trade-off, until you explain there, I saved the picture of the morph as a PNG image in a Stream as:
morph := WatchMorph new. myStream := RWBinaryOrTextStream with: (ByteArray new: 20). PNGReadWriter putForm: morph imageForm onStream: myStream. maSession commit: [maSession root at: 'image' put: myStream]
then
(PNGReadWriter formFromStream: (maSession root at: 'image')) display
worked as a charm.
I have one question regarding your use of the readStrategy, why do you use a readToDepth of 999? As I understand the readStrategy I believe a value of 1 will just be enought.
Hilaire
Chris Muller a écrit :
"*** add this code ***" maSession readStrategy: ((MaReadStrategy minimumDepth: 1) onAny: Form readToDepth: 999 ; yourself).
(maSession root at: 'test') display
ReadStrategy's are critical to using Magma. They are used for 1) optimizing performance, 2) ensuring any MagmaProxy is never sent an inlined message (like ==) or 3) ensuring any MagmaProxy is never an argument to a primitive.
So why was the 'offset' a Point instead of a Proxy? Because, if you look at MaReadStrategy>>#initializeDefaultSpecifications, you will see that Point, among several other classes, is part of the default ReadStrategy to read 99 levels deep.
For the next release I will add BitMap and Form to this list as well so you don't have to put them into your own ReadStrategy in the future.
Thanks for finding this..!
- Chris