I have images stored in GridFS for MongoDB. When I pull the image out, I want to resize it and then store it back into the database. I tried this:
$image = $grid_collection ->findOne(array('_id' => new MongoID($id)));
new Imagick($image -> getBytes());
But that throws an error in Imagick. Now I can write it out to file temporarily to disk and have Imagick read the file, but that seems the long way around. Any suggestions on a better way to do this?