Displaying SQL Image Fields in Table (Only Partial Image Visible)
Hi,
I am working with a SQL table that contains fields with the image data type. I convert the field to Base64 and display it in a Qlik table. However, most of the images are not shown completely – only a cropped or partial version of the image appears in the table.
Is there a way to properly render the full image from a SQL image field in Qlik so that the entire picture is visible in the table cell? Adding sample screenshots and the code snippet for the xml casting:
[IMAGE]:
LOAD
IMAGE_NAME,
IDENTY_ID,
IMAGE_DATA,
text(ImageBase64) as ImageBase64
;
select
IMAGE_NAME,
IDENTY_ID,
IMAGE_DATA,
'data:image/jpg;base64,' +
CAST(
CAST('' AS XML).value(
'xs:base64Binary(sql:column("IMAGE_DATA_CASTED"))',
'VARCHAR(MAX)'
)
AS VARCHAR(MAX)) AS ImageBase64
FROM (
SELECT
"RESIM_ADI" AS IMAGE_NAME,
IDENTY_ID,
IMAGE_DATA,
CAST(RESIM_DATA AS VARBINARY(MAX)) AS IMAGE_DATA_CASTED
FROM NEWBILMEDICAL.dbo."HASTA_RESIM"
// where IDENTY_ID in ('476544','477240')
) AS X;
Any advice or example would be greatly appreciated.