mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged DEV to HEAD (4.2.0)
ALF-2875 : Rendition Service transforms incorrect mimetypes - Added a check of target mimeType git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54634 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -241,6 +241,30 @@ public class ImageRenderingEngine extends AbstractTransformationRenderingEngine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check mimeType of target.
|
||||||
|
* @param context
|
||||||
|
*/
|
||||||
|
private void checkTargetMimeType(RenderingContext context)
|
||||||
|
{
|
||||||
|
String targetMimeType = getTargetMimeType(context);
|
||||||
|
// Target mime type should only be an image MIME type
|
||||||
|
if (targetMimeType == null || !targetMimeType.startsWith("image"))
|
||||||
|
{
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
msg.append("Target has illegal non-image MIME type: ").append(targetMimeType).append(". ")
|
||||||
|
.append("Use image as a source or configure target parameter \"").append(PARAM_MIME_TYPE).append("\"");
|
||||||
|
throw new IllegalArgumentException(msg.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void render(RenderingContext context)
|
||||||
|
{
|
||||||
|
checkTargetMimeType(context);
|
||||||
|
super.render(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @seeorg.alfresco.repo.rendition.executer.AbstractRenderingEngine#
|
* @seeorg.alfresco.repo.rendition.executer.AbstractRenderingEngine#
|
||||||
|
Reference in New Issue
Block a user