/** * Sets the scaling width for the image.<p> * * If no valid integer is given, then "0" is used as value.<p> * * @param value the scaling width for the image to set */ public void setWidth(String value) { m_scaler.setWidth(CmsStringUtil.getIntValueRounded(value, 0, SCALE_ATTR_WIDTH)); } }
/** * Sets the scaling width for the image.<p> * * If no valid integer is given, then "0" is used as value.<p> * * @param value the scaling width for the image to set */ public void setWidth(String value) { m_scaler.setWidth(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_WIDTH)); }
/** * Creates a new image scaler based on the given base scaler and the given width and height.<p> * * @param base the base scaler to initialize the values with * @param width the width to set for this scaler * @param height the height to set for this scaler */ protected CmsImageScaler(CmsImageScaler base, int width, int height) { initValuesFrom(base); setWidth(width); setHeight(height); }
/** * Creates a new image scaler based on the given base scaler and the given width and height.<p> * * @param base the base scaler to initialize the values with * @param width the width to set for this scaler * @param height the height to set for this scaler */ protected CmsImageScaler(CmsImageScaler base, int width, int height) { initValuesFrom(base); setWidth(width); setHeight(height); }
/** * Sets the image size for thumbnails and the detail view.<p> * * @param configValue the String value of the configuration file * @param isThumbNail flag indicating if the thumbnail or the detail view configuration is set * @throws Exception if parsing the configuration fails */ private void setImageSize(String configValue, boolean isThumbNail) throws Exception { List sizes = CmsStringUtil.splitAsList(getConfigurationValue(configValue, "200x150"), 'x', true); int width = Integer.parseInt((String)sizes.get(0)); int height = Integer.parseInt((String)sizes.get(1)); if (isThumbNail) { getThumbNailScaler().setWidth(width); getThumbNailScaler().setHeight(height); } else { getDetailImageScaler().setWidth(width); getDetailImageScaler().setHeight(height); } }
/** * Returns the initialized image scaler object used to generate thumbnails for the dialog form.<p> * * @return the initialized image scaler object used to generate thumbnails for the dialog form */ protected CmsImageScaler getImageScaler() { if (m_imageScaler == null) { // not initialized, create image scaler with default settings m_imageScaler = new CmsImageScaler(); m_imageScaler.setWidth(THUMB_WIDTH); m_imageScaler.setHeight(THUMB_HEIGHT); m_imageScaler.setRenderMode(Simapi.RENDER_SPEED); m_imageScaler.setColor(new Color(0, 0, 0)); m_imageScaler.setType(1); } return m_imageScaler; }
/** * Returns the initialized image scaler object used to generate thumbnails for the dialog form.<p> * * @return the initialized image scaler object used to generate thumbnails for the dialog form */ protected CmsImageScaler getImageScaler() { if (m_imageScaler == null) { // not initialized, create image scaler with default settings m_imageScaler = new CmsImageScaler(); m_imageScaler.setWidth(THUMB_WIDTH); m_imageScaler.setHeight(THUMB_HEIGHT); m_imageScaler.setRenderMode(Simapi.RENDER_SPEED); m_imageScaler.setColor(new Color(0, 0, 0)); m_imageScaler.setType(1); } return m_imageScaler; }
/** * Returns the HTML for the large image to show in a popup window with a desired width of 600px.<p> * * @param cms the initialized JSP action element * @param imgUri the URI of the image to link to * @param imgSize the image size property value containing the original image information * @return the HTML for the large image to show in a popup window */ public static String buildLargeImageTag(CmsJspActionElement cms, String imgUri, String imgSize) { // create scaler instance of original image CmsImageScaler origImage = new CmsImageScaler(imgSize); // create scaler with desired image width CmsImageScaler scaler = new CmsImageScaler(); scaler.setWidth(600); // return scaler with result image width CmsImageScaler resultScaler = origImage.getWidthScaler(scaler); return cms.img(imgUri, resultScaler, null); }
/** * Returns an initialized image scaler depending on the image align to use.<p> * * @param paragraphType the paragraph type to show * @param imgSize the image size property value containing the original image information * @return an initialized image scaler depending on the image align to use */ protected CmsImageScaler getImageScaler(String paragraphType, String imgSize) { // get the image width variant to use from the paragraph layout pattern Map String imgWidthVariant = (String)getLayoutPatterns().get(paragraphType); if (CmsStringUtil.isEmpty(imgWidthVariant)) { // did not find a value, provide a default width imgWidthVariant = IMG_WIDTH_MEDIUM; } // calculate image width to use depending on the column width int imgWidth = calculateImageWidth(imgWidthVariant); // create scaler instance of original image CmsImageScaler origImage = new CmsImageScaler(imgSize); // create scaler with desired image width CmsImageScaler scaler = new CmsImageScaler(); scaler.setWidth(imgWidth); // return scaler with result image width return origImage.getWidthScaler(scaler); }
scaler.setWidth(downScaler.getWidth());
scaler.setWidth(downScaler.getWidth());
scaler.setWidth(60); scaler.setHeight(60);
hiDpiScaler.setWidth(width); hiDpiScaler.setHeight(height);
scaler.setWidth(60); scaler.setHeight(60);
m_defaultScaleParams.setWidth(120); m_defaultScaleParams.setHeight(90); m_defaultScaleParams.setColor(new Color(221, 221, 221));
m_defaultScaleParams.setWidth(120); m_defaultScaleParams.setHeight(90); m_defaultScaleParams.setColor(new Color(221, 221, 221));
if (scaler.getType() == 5) { cropScaler.setWidth(cropScaler.getCropWidth()); cropScaler.setHeight(cropScaler.getCropHeight());
scaler.setType(2); scaler.setHeight(192); scaler.setWidth(192); byte[] content = scaler.scaleImage(tempFile); String previousImage = (String)user.getAdditionalInfo(CmsUserIconHelper.USER_IMAGE_INFO);