We are having problems registering a custom rendition to be available for multiple image mimetypes. When it registers it is only available for the image mimetype that we first create a rendition for using the custom rendition.
We have configured a local transform as follows. Its pretty much the same the doclib rendition except for a resize.
The config is as follows:
In shared/classes/alfresco/extension/transform/renditions/0050-nswtaAssetLow.json file
------------------------------------
{
"renditions": [
{
"renditionName": "nswtaAssetLow",
"targetMediaType": "image/png",
"options": [
{"name": "resizeWidth", "value": 200},
{"name": "resizeHeight", "value": 200},
{"name": "allowEnlargement", "value": false},
{"name": "maintainAspectRatio", "value": true},
{"name": "autoOrient", "value": true},
{"name": "thumbnail", "value": true},
{"name": "startPage", "value": "0"},
{"name": "endPage", "value": "0"}
]
}
]
}In alfresco-global.properties
---------------------------------------------------
transform.service.enabled=false
localTransform.core-aio.url=http://10.132.2.138:8090/
local.transform.service.enabled=true
rendition.config.dir=shared/classes/alfresco/extension/transform/renditions/
rendition.config.cronExpression=2 30 0/1 * * ?
rendition.config.initialAndOnError.cronExpression=0/10 * * * * ?
Note we are using the aio transform engine.
If we call the rendition service api to create a rendition for a source jpg file it works and creates a rendition as a thumbnail.
http://10.132.2.138:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/761cd2ff-a6af-4789-9aa7-3fe8bb471683/renditions
body:
{
"id": "nswtaAssetLow"
}
However, this custom rendition should be available for a png source file as well. If we call the same rendition api for a png file it fails and gives the error message:
{
"error": {
"errorKey": "framework.exception.ApiDefault",
"statusCode": 400,
"briefSummary": "Local transform nswtaAssetLow from image/png is unsupported",
"stackTrace": "For security reasons the stack trace is no longer displayed, but the property is kept for previous versions",
"descriptionURL": "https://api-explorer.alfresco.com"
}
}
The interesting this is that if we stop alfresco and restart alfresco and then call the rendition service for a png source file it works fine and creates the rendition thumbnail. However, now it is not possible to create a jpg thumbnail.
Am I missing something in how I register the rendition so it supports creating a rendition for both jpg and png source files. I am very confused by this issue as from my understanding it should work for both png and jpg mimetypes once registered. I therefore am wondering if I need to do something extra to register it to work for both mimetypes.
Regards
Brian