How to render an Image file (Blob) stored in the database using a custom tag, I used to render a logo but the image is being crashed and the output is the byte array.
This is what I tried:
def logo = { attrs, body ->
if(session?.companyId && session?.companyId != 'null'){
Company company = Company.findById(session?.companyId)
if (!company || !company?.logo) {
println "No response..."
out <<"<img src='/cdc/static/images/logo.png' width='150' height='70' />"
}
else{
println "Writing..."
out << "<img src='"
out << company?.logo
out << "' width='150' height='70' />"
}
}
else{
println "No response..."
//out <<"<img src='/cdc/static/images/logo.png' width='150' height='70' />"
}
}
The output is as follows:


How can the company?.logo be rendered as an image and not a byte array ?