Inline image for email

I have images saved in a MySQL table. I need resized images for an HTML email. I have not found a way to get the data from the resizing code moved into a php variable that I can then use to create the image in the email.

For example, to use an image from the file system, I would use:

$content = file_get_contents(path_to_file);
$inline = chunk_split(base64_encode($content));

I have the image content in a field in the MySQL table and using full size is no a problem but if I reduce the image, I can’t figure out how to capture the reduced content. :frowning:

The image resizing code returns an image identifier which I can output to a browser or to a file but I need to capture it in a variable to use as shown above. Can this be done?

Thanks for your help! :slight_smile: