John L. Clark wrote: > The problem that my authors have described is that their images are > being cropped (by the XXE interface) when they are larger than the width > of the page; they only want to scale their images in order to fit them > within the page. If the page width is large enough, they want these > images displayed at their intrinsic size. > > I have described to them the use of the width attribute, but this (with > scalefit="1") causes the images to always be scaled to exactly the width > of the XXE document display, which often causes images to be enlarged, > with significant quality loss. > > I think the clipping of images in XXE is a poor feature, and would like > to request a feature enhancement that a default viewport be set for > images with a value either equal to the intrinsic size of the image > (which might force the document to be scrolled in order to see the whole > image) or equal to the scaled height and width of an image in order to > fit it in the width of the document display.
--> I'm not sure to understand your feature request. Do you want the default viewport size to be [a] min(intrinsic_image_size, document_view_size) OR [b] *configurable* in the CSS: equal to intrinsic_image_size or equal to document_view_size? In both cases, there are problems: [a] min(intrinsic_image_size, document_view_size) is not a good value for a *default*. When the viewport size depends on the size of the document view, this makes XXE even slower than it already is. [b] I don't see how we could implement this feature request given the architecture of XXE. We could imagine adding two parameters to the image-viewport DocBook specialization (com.xmlmind.xmleditapp.docbook.Graphic): * default-viewport-width * default-viewport-height which would let you specify the default viewport size you want. The problem is that there is no way to specify the intrinsic size of the image for the default viewport size. (Other values, fixed: 5in or relative: 80%, would be OK.) --> Your problem can be solved without adding anything new to XXE, but you need to give up using com.xmlmind.xmleditapp.docbook.Graphic. Our docbook.css is modular. You need to redefine the rules found in image.imp (or in thumbnail.imp, see below). Instead of using the DocBook specialization com.xmlmind.xmleditapp.docbook.Graphic, directly use the generic image-viewport gadget. It can do everything you want. See http://www.xmlmind.com/xmleditor/_distrib/docs/csssupport/ch05s22.html What follows is an excerpt of XXE_install_dir/docs/configure/samples/imagedemo/imagedemo.css: --- image_eu, image_eb { /* * No need to specify data-type. The image-viewport will * find it by itself. */ content: image-viewport( viewport-width, attr(width), viewport-height, attr(height), preserve-aspect-ratio, attr(preserve_aspect_ratio), content-width, xpath("if(@content_width='scale_to_fit',\ 'scale-to-fit',\ @content_width)"), content-height, xpath("if(@content_height='scale_to_fit',\ 'scale-to-fit',\ @content_height)"), horizontal-align, xpath("if(@anchor='west' or @anchor='north_west' or @anchor='south_west',\ 'left',\ @anchor='center' or @anchor='north' or @anchor='south',\ 'center',\ @anchor='east' or @anchor='north_east' or @anchor='south_east',\ 'right',\ 'center')"), vertical-align, xpath("if(@anchor='north' or @anchor='north_east' or @anchor='north_west',\ 'top',\ @anchor='center' or @anchor='east' or @anchor='west',\ 'middle',\ @anchor='south' or @anchor='south_east' or @anchor='south_west',\ 'bottom',\ 'middle')") ); } --- As you can see, properly configuring the image-viewport gadget can be challenging but we believe it is flexible enough for almost all needs. > Interestingly, if this documentation *were* accurate it would meet my > request for enhancement above. Also, I thought that I remembered a past > version of XXE where images did get scaled if they were too wide, by > default. That's what I want If you miss the behavior of older DocBook CSS style sheets, the problem is even simpler to solve: * edit docbook.xxe * unmark thumbnails.css as alternate * mark docbook.css as alternate thumbnails.css contains CSS rules such as the following one: --- graphic, inlinegraphic, imagedata { content: image(attr(fileref), -400, -100, smooth); } --- which means: * Ignore DocBook attributes such as width, contentdepth, scalefit, etc. In other words, don't try to be WYSIWYG. * If the image is larger than 400x100, scale it down. Of course, you'll need to change "-400, -100" to something related to your page size: "-150mm, -150mm" for example (sorry for the metric units). See http://www.xmlmind.com/xmleditor/_distrib/docs/csssupport/ch05s21.html

