make wiImage serializable
Status: Abandoned
Brought to you by:
gasper_k
serialize calls __sleep() and unserialize calls __wakeup(). It's possible to store the image data as string in a private variable upon sleep and restore it (recreate and reload from the string) upon wakeup.
see:
- http://si.php.net/manual/en/language.oop5.magic.php
- __sleep() / __wakeup()
- serialize() / unserialize()
Logged In: YES
user_id=1598278
Originator: YES
suggestion: store image data in a string in a private property (lossless png format), return that private property. Upon wakeup, restore the image (handle) from the string. Possible problems: palette depth (have to confirm).
Logged In: YES
user_id=1598278
Originator: YES
possible issue: upon calling __sleep, the image data is supposed to be stored as a string in a private variable, resulting in a bigger memory usage. The memory gets cleared when the image is destroyed. What format to store in? To account for transparencies and all, PNG or GD2 are probably the only two options.
This feature has been implemented in SVN.