I can't seem to find an example of the proper syntax/method for initializing an ImageMagick Magick++ object from an iostream stream_buffer in C++.
I'm trying to use the result from an aws sdk getObject which seems to return a stream buffer to push into ImageMagick to create thumbnails via lambda on demand.
example of the relevant code from the aws-sdk-cpp I'm using to retrieve the object:
auto get_object_outcome = s3_client.GetObject(object_request);
if (get_object_outcome.IsSuccess())
{
// Get an Aws::IOStream reference to the retrieved file
auto &retrieved_file = get_object_outcome.GetResultWithOwnership().GetBody();
// read the object's contents and write to a file
std::ofstream output_file(file_name, std::ios::binary);
output_file << retrieved_file.rdbuf();
return true;
}
else
{
auto error = get_object_outcome.GetError();
std::cout << "ERROR: " << error.GetExceptionName() << ": "
<< error.GetMessage() << std::endl;
return false;
}
Any help is appreciated - new to c++ so I'm not yet versed in converting more advanced data formats such as streams/blobs/buffers.