General XMetaL Discussion
periardy June 10, 2009 at 8:31 pm
Embedded images in xml get automatically generated width/heightJune 10, 2009 at 8:31 pmParticipants 0Replies 1Last Activity 13 years, 3 months ago
Is there a way to disable the automatic adding of the width and height attributes for image elements? Once a document is rendered in XMAX, the image element automatically gets a width and height based on image properties. This works fine for most cases, but sometimes a placeholder can be used and the “real” image added to the xml afterwards, it is cumbersome to go back and change the attributes all the time.
We are using an api method called InsertImage and providing only image source and alt text, it still created the width and height. Is there some other way?
thanksDerek Read June 10, 2009 at 8:42 pm
Reply to: Embedded images in xml get automatically generated width/heightJune 10, 2009 at 8:42 pm
The only way to disable this is to alter the CTM file settings to remove the mapping from the attributes for width and height. This is typically done using the XMetaL Developer CTM Editor.
Here is an example from the Journalist demo included with XMetaL Author:
Removing the values in red will disable the automatic insertion of the width and height. Note however, that this also disables the feature that will resize the image based on those values, so if you want to override the default (ie: 100%) size (obtained by reading the content of the bitmap image) you must leave these alone. This will not be an issue if you always want images to appear at their default size during editing. This might also be less of an issue if you don't even allow your end users to modify these values (which is easy with XMAX because an Attribute Inspector is not provided, and if you do provide one you can code it so that these attributes are not available).
- You must be logged in to reply to this topic.