mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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
This commit is contained in:
@@ -242,8 +242,8 @@
|
|||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Size limits (KBytes) by mimetype of original source content after which thumbnails
|
<!-- Size limits (KBytes) by mimetype of original source content after which thumbnails
|
||||||
are not created. If the mimetype is not specified or the value is less than or
|
are not created. If the mimetype is not specified or the value is less than zero,
|
||||||
equal to zero, a thumbnail will be generated regardless of size. -->
|
a thumbnail will be generated regardless of size. -->
|
||||||
<util:map id="mimetypeMaxSourceSizeKBytes"
|
<util:map id="mimetypeMaxSourceSizeKBytes"
|
||||||
map-class="java.util.HashMap"
|
map-class="java.util.HashMap"
|
||||||
key-type="java.lang.String"
|
key-type="java.lang.String"
|
||||||
|
@@ -157,16 +157,17 @@ public class CreateThumbnailActionExecuter extends ActionExecuterAbstractBase
|
|||||||
String mimetype = content.getMimetype();
|
String mimetype = content.getMimetype();
|
||||||
if (!registry.isThumbnailDefinitionAvailable(content.getContentUrl(), mimetype, content.getSize(), details))
|
if (!registry.isThumbnailDefinitionAvailable(content.getContentUrl(), mimetype, content.getSize(), details))
|
||||||
{
|
{
|
||||||
logger.info("Unable to create thumbnail '" + details.getName() + "' for " +
|
logger.debug("Unable to create thumbnail '" + details.getName() + "' for " +
|
||||||
mimetype + " as no transformer is currently available");
|
mimetype + " as no transformer is currently available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mimetypeMaxSourceSizeKBytes != null)
|
if (mimetypeMaxSourceSizeKBytes != null)
|
||||||
{
|
{
|
||||||
Long maxSourceSizeKBytes = mimetypeMaxSourceSizeKBytes.get(mimetype);
|
Long maxSourceSizeKBytes = mimetypeMaxSourceSizeKBytes.get(mimetype);
|
||||||
if (maxSourceSizeKBytes != null && maxSourceSizeKBytes > 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
|
return; //avoid transform
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -176,12 +176,14 @@ public class UpdateThumbnailActionExecuter extends ActionExecuterAbstractBase
|
|||||||
if(contentProp instanceof ContentData)
|
if(contentProp instanceof ContentData)
|
||||||
{
|
{
|
||||||
ContentData content = (ContentData)contentProp;
|
ContentData content = (ContentData)contentProp;
|
||||||
|
String mimetype = content.getMimetype();
|
||||||
if (mimetypeMaxSourceSizeKBytes != null)
|
if (mimetypeMaxSourceSizeKBytes != null)
|
||||||
{
|
{
|
||||||
Long maxSourceSizeKBytes = mimetypeMaxSourceSizeKBytes.get(content.getMimetype());
|
Long maxSourceSizeKBytes = mimetypeMaxSourceSizeKBytes.get(mimetype);
|
||||||
if (maxSourceSizeKBytes != null && maxSourceSizeKBytes < (content.getSize()/1024L))
|
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
|
return; //avoid transform
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user