[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Image size with XSL?
On Sun, Dec 18, 2016 at 07:54:10PM -0000, Mark Wilson mark@xxxxxxxxxxxx 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|