xsl-list
[Top] [All Lists]

Re: [xsl] Image size with XSL?

2016-12-18 14:15:13
Thanks Graydon,
I will look into what you have said and not post further here as apparently XSLT is not going to come to my rescue.
Mark

On 12/18/2016 1:03 PM, Graydon graydon(_at_)marost(_dot_)ca wrote:
On Sun, Dec 18, 2016 at 07:54:10PM -0000, Mark Wilson 
mark(_at_)knihtisk(_dot_)org scripsit:
[snip]
I would like to add the placement-index to the XML data source
programmatically. Is there a way to obtain the height or width of a jpeg
image from the file itself (image.jpg, for instance) using XSLT? Or, can
someone suggest another way to do this programmatically?
You can't do that directly with XSLT. (Well... Turing-complete
programming language.  You can't do that easily and absent considerable
suffering with XSLT.)  The usual way is to use something
like http://www.graphicsmagick.org/ and a scripting language to extract
the information you want and to stick it in meta-data XML files
associated with the image.  (So you'd have image.jpg and
image_meta.xml.)  Then XSLT can read the image_meta.xml file to get the
necessary information.

This has problems because when you have lots of little files file-IO
tends to dominate your run time, but it's also hard to avoid, and at
least this way you have the prospect of stuffing all the imagine meta
into a single collection at the start.

-- Graydon


--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>