Originally, I had a table in SQL Server with a field that contained an URL to a picture.
I created an XSL template to customize the info window of that table in ArcMap. To show that image I only had to do this:
<xsl:variable name="pic" select="$theField[FieldName='PIC']/FieldValue"/>
<img border="0" src="{$pic}" width="200"/>
Now, the picture is stored as a blob in the database. A VARBINARY
field.
How can I set the <img>
tag from a blob source?
I've been reading several answers for similar issues here and here, but they don't fit my case or I'm being incapable of doing it.
Is even possible to accomplish it with just an XSL template?
I have already tried this (and similar variations):
<fo:instream-foreign-object content-type="image/png">
<xsl:variable name="pic" select="$theField[FieldName='PIC']/FieldValue"/>
<img border="0" src="{$pic}" width="200"/>
</fo:instream-foreign-object>
If the image is in a format that FOP supports (likely) and you can convert the image to Base64 (?) and FOP can use the data:
scheme to inline the image data in the src
property value (I can't find anything to say that it can or cannot) then you would be able to do something like:
<fo:external-graphic
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAB
3RJTUUH1AIFCDIuN9BfzQAAAAlw ... ="/>
Otherwise, you may have to come up with a URL to put in the src
property value so that FOP can access the image directly from the database.