[ 
https://issues.apache.org/jira/browse/OFBIZ-4678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206551#comment-13206551
 ] 

Wai commented on OFBIZ-4678:
----------------------------

The purpose of ofbiz-4678 was to harmonize on the display size of images with a 
standardized set of width/height constraints in which an image must fit and 
preserve the aspect ratio of images.

Currently the source files (eg. ftl, xml) either manually specifies the width 
or height of a displayed image (ie widget <image> and html <img> tag).  The 
problem with specifying only one constraint is that an image can affect the 
layout of the page if the user uploads an image where the aspect ratio could be 
large.

Some ftl and xml files specify both the width and the height.  The problem with 
this is that if the aspect ratio of the image in question does not match that 
of the width and height of the <img> tag, the image would be displayed 
distorted.

The solution was to create a standardized set of CSS styles that both configure 
the displayed image size and preserve the image aspect ratio (eg. thumbnail 
size, medium size and large size).  Of course, the developers can further 
define or modify the styles to suit their need.

By using CSS, one can change the size of displayed images without having to 
tamper with the ftl and/or xml files.  This helps to reduce potential bugs that 
come with modifying the ftl and xml files.  The existing way of doing things is 
to go through each ftl or xml file in question and manually modify the width 
and/or height of the <image> and/or <img> tag.

The question about the "border" around images.  If you do not wish to have a 
border around the image, just remove it from the CSS style.  It's that easy :)  
No need to change anything else.  Ie. configuration to the image is done on the 
CSS style and not on the <image>, <img> tag.

In addition to this post, I have changed the CSS styles for the displayed 
images.  The existing one did not work properly.  Please refer to the latest 
patch.

NB: The current patch does not apply to all displayed images.  I have only made 
appropriate modifications to widget <image> and html <img> tags that have 
either specified the width and/or height.  There are numerous <image> and <img> 
tags spread all over the project that do not specify dimensions.  I would have 
to modify them as I encountered them when I could see where and how they are 
displayed on the screen.  Note that these images would not be affect by this 
patch.

                
> widget <image> tag to use css for resizing
> ------------------------------------------
>
>                 Key: OFBIZ-4678
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4678
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: SVN trunk
>            Reporter: Wai
>            Priority: Minor
>         Attachments: ofbiz-4678.patch, ofbiz-4678.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to