【发布时间】:2021-06-08 09:28:46
【问题描述】:
我正在尝试从资产中获取 ICC PRofile 信息,但没有成功。有没有办法在工作流步骤中的资产处理期间获取这些字段?
我有一个类似的代码来获取在继承自 WorkflowProcess 的类中实现的资产对象(它只是为了描述我的问题):
ResourceResolver resolver = workflowSession.adaptTo(ResourceResolver.class);
String path = workItem.getWorkflowData().getPayload().toString();
if (StringUtils.contains(path, JcrConstants.JCR_CONTENT)) {
path = StringUtils.substringBefore(path, JcrConstants.JCR_CONTENT);
}
Resource resource = resolver.getResource(path);
Asset asset = resource == null ? null : resource.adaptTo(Asset.class);
if (asset == null) {
log.info("Asset is null, skipping metadata extraction");
}
assert asset != null;
String layerName = asset.getMetadata("photoshop:LayerName") != null ? asset.getMetadata("photoshop:LayerName").toString() : "";
Map<String, Object> meta = asset.getMetadata();
在最后一行,我看不到元数据 ICC 字段。
有什么建议吗?
【问题讨论】: