Image
Image copied to clipboard
Re-applying serialized operations
Is this possible? It seems strange to expose the serialization method as public
without having a way to re-apply the serialized operations
https://github.com/Gregwar/Image/blob/master/Image.php#L367
Hello, Maybe this method should not be public. What is your use case? Why would you like to re-apply operation?
Well in my application I'm looking to store operations that need to happen to my user images on the fly (so I can keep the existing source image intact). I'm currently storing these image_operations
in json form in my database like the below:
{
"crop": {
"x": 4,
"y": 8,
"x2": 800,
"y2": 800
},
"rotate": -90
}
It would be nice to be able to do something like applyOperationsArray(...)
then an array of operations to perform like above. So then I looked at the serialization of the operations and it's kind of similar to the above I think. What's your thoughts?