From bdc0214b79187ff251c0936813057be539788529 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Thu, 23 Feb 2012 11:03:50 +0000 Subject: [PATCH] Merged V4.0-BUG-FIX (4.0.2) to HEAD 34160: Merged V4.0 (V4.0.1) to V4.0-BUG-FIX (4.0.2) 34159: ALF-12725,ALF-13011: Merge V3.4-BUG-FIX (3.4.9) to V4.0 (V4.0.1) 34151: Merged V3.4 (3.4.8) to V3.4-BUG-FIX (3.4.9) 34121: Merged BELARUS/V3.4-BUG-FIX-2012_01_26 to V3.4 (3.4.8) Should have been done in 3.4.7 in ALF-12174 but was not found by Eclipse search 34100: ALF-12948 : Copyright year on "About Alfresco" page is out of date Updated copyright year to 2012. 34150: ALF-10976 (relates to ALF-10412) - Thumbnail mimetype check should have been >= 0 not > 0. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34184 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/thumbnail-service-context.xml | 4 ++-- .../repo/thumbnail/CreateThumbnailActionExecuter.java | 7 ++++--- .../repo/thumbnail/UpdateThumbnailActionExecuter.java | 10 ++++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/config/alfresco/thumbnail-service-context.xml b/config/alfresco/thumbnail-service-context.xml index fe3c2044de..6531b08cab 100644 --- a/config/alfresco/thumbnail-service-context.xml +++ b/config/alfresco/thumbnail-service-context.xml @@ -242,8 +242,8 @@ + are not created. If the mimetype is not specified or the value is less than zero, + a thumbnail will be generated regardless of size. --> 0 && maxSourceSizeKBytes <= (content.getSize()/1024L)) + if (maxSourceSizeKBytes != null && maxSourceSizeKBytes >= 0 && maxSourceSizeKBytes < (content.getSize()/1024L)) { - logger.info("Creation of " + details.getName()+ " thumbnail from '" + mimetype + "' , content is too big ("+(content.getSize()/1024L)+"K >= "+maxSourceSizeKBytes+"K)"); + logger.debug("Unable to create thumbnail '" + details.getName() + "' for " + + mimetype + " as content is too large ("+(content.getSize()/1024L)+"K > "+maxSourceSizeKBytes+"K)"); return; //avoid transform } } diff --git a/source/java/org/alfresco/repo/thumbnail/UpdateThumbnailActionExecuter.java b/source/java/org/alfresco/repo/thumbnail/UpdateThumbnailActionExecuter.java index 23d57bb828..0cf6af5b86 100644 --- a/source/java/org/alfresco/repo/thumbnail/UpdateThumbnailActionExecuter.java +++ b/source/java/org/alfresco/repo/thumbnail/UpdateThumbnailActionExecuter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -176,12 +176,14 @@ public class UpdateThumbnailActionExecuter extends ActionExecuterAbstractBase if(contentProp instanceof ContentData) { ContentData content = (ContentData)contentProp; + String mimetype = content.getMimetype(); if (mimetypeMaxSourceSizeKBytes != null) { - Long maxSourceSizeKBytes = mimetypeMaxSourceSizeKBytes.get(content.getMimetype()); - if (maxSourceSizeKBytes != null && maxSourceSizeKBytes < (content.getSize()/1024L)) + Long maxSourceSizeKBytes = mimetypeMaxSourceSizeKBytes.get(mimetype); + if (maxSourceSizeKBytes != null && maxSourceSizeKBytes >= 0 && maxSourceSizeKBytes < (content.getSize()/1024L)) { - logger.info("Creation of thumbnail, '" + details.getName() + " , content too big ("+maxSourceSizeKBytes+"K)"); + logger.debug("Unable to create thumbnail '" + details.getName() + "' for " + + mimetype + " as content is too large ("+(content.getSize()/1024L)+"K > "+maxSourceSizeKBytes+"K)"); return; //avoid transform } }