Encode and Include Images in XML

JAMES IRVING jirv898 at msn.com
Sat May 20 21:08:42 UTC 2017


This might be off-topic, but I would like suggestions as to how Tellico handles cover images in creating an XML export file.  I am trying to create an XML file I can use as import to a Tellico Video collection.

My source data is coming from a MySQL database (VideoDB web applicaiton) which includes an element that includes a file path; for example:

<imgurl>cache/img/1045.jpg</imgurl>

Whereas Tellico XML export file includes the <cover> element which points to an <image> element with contents that have been encoded to a Base64 string; example:

<cover>f4910a966f8a3b0c2a4ea2e68d15ab5a.jpeg</cover>

and at the end of the Tellico XML file is the <images/> data

<images>

<image width="77" format="JPEG" height="140" id="f4910a966f8a3b0c2a4ea2e68d15ab5a.jpeg">/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0
                  bytes removed for simplicity
yfyrS0u/vtMu40vb67gUKHV0RZ0C4yD3OPcVs+M72abwZZIxAWSWJmwMZOxj//2Q==

</image>

</images>

I am using XSLT 1.0; and cannot find a way to tell XSLT to reach out to run the Encode action and return the base64 string that can be set to the contents of the <image> element.  Tellico seems to be able to do that; but probably uses C++ code and appropriate library functions. I am by no means an expert on XML/XSLT.  If there is a better way I am open to suggestions.

I have over 1,000 videos in my collection; I might have to chop my conversion into small groups, but I would prefer to not have to Encode all my cover images manually to individual files that get saved to disk and then fetch one at a time for an <image> element.  The encode string only needs to exist long enough to get placed into the <image> element.

Thanks in advance for any ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/tellico-users/attachments/20170520/ad0b0bbb/attachment.html>


More information about the tellico-users mailing list