保存 jsignature 图像不再透明
Saving jsignature image no longer transparent
如何将此 base64 图像从 jsignature 保存到透明 ping?我以前可以成功保存透明背景的图像,现在只能保存黑色背景。我不确定在最近的两个 ColdFusion 或 Java 更新之一之后出现了什么问题。 (我是 运行 Cold Fusion 2016 update 10)图像数据通过表单字段传入 local.signaturedata & POST。
<cfimage action="read" source="#imageReadBase64(local.signaturedata)#" name="local.imgCanvas"> <!--- png --->
<cfset ImageResize(local.imgCanvas,"",local.height)> <!--- png --->
<cfset local.bimg = imageGetBufferedImage(local.imgCanvas)>
<!--- RGB --->
<cfset local.rCS = createObject("java","java.awt.color.ColorSpace").CS_sRGB><!--- PROD: CS_sRGB, TEST: CS_LINEAR_RGB, TYPE_RGB, TYPE_INT_ARGB --->
<cfset local.rgb = createObject("java","java.awt.color.ColorSpace").getInstance(local.rCS)>
<cfset local.convert = createObject("java","java.awt.image.ColorConvertOp").init(local.rgb,javaCast("null",""))>
<cfset local.newImage = local.convert.filter(local.bimg, javaCast("null",""))>
<cfset local.imgCanvasConverted = imageNew(local.newImage)><!--- PROD: imageNew(local.newImage) --->
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXIAAABdCAYAAAC4qe1eAAANZ0lEQVR4Xu2de4xcZRnGn3emlG2gXOTWKLBnBcUAQqsVhEKgRNmZIbFF+EOMpCXGEGlQjBeMUS7BREQRSgEJwbQkhGgo0EaZs4VoCwgmBqFIScql7NmWUmyQS4m0ZbvnNd85O92dy9m57cyc851nkqZJ57u87+/59unZ73wXAT8kQAIkQAKJJiCJjp7BkwAJkAAJgEbOQUACJEACCSdAI0+4gAyfBEiABGjkHAMkQAIkkHACNPKEC8jwSYAESIBGzjFAAiRAAgknQCNPuIAMnwRIgARo5BwDJEACJJBwAjTyhAvI8EmABEiARs4xQAIkQAIJJ0AjT7iADJ8ESIAEaOQcAyRAAiSQcAI08oQLyPBJgARIgEbOMUACJEACCSdAI0+4gD0N33EdQBYDeiaAzdWxyBzAByBvV3zXB+jnIJnnM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ac92NjPwcxxz6e/zj7N2xhBOsytm7BPCXApNu6qkf7AcAbue54fVBsUSyCHBqJVl6tR+t45rbghbVbUiwCyp/wdLBy2Oz1tzcWK+YB+ALdeMvL0ADbxIYiyeLAI08WXq1H214ScKGcDt65Nu/iX4Eo1C5C9Dl8PJe+wE02UJp6kT8q2rOe0/dHA28SdwsnkwCNPJk6tZe1IE5wmwYOrSphgTPQfVNQEzdSR+dA2TM0r63q9ur9d1U5UstyFyIHgvF/PBfoq6rL4sjfO0TvtS8H+i7hrsym1KYhRNKgEaeUOHaDju4+WbshQpDnvT+u4Gn9baDaKSBpuJYC+gqeAVeNt0IWpaxhgCN3BopW0jk+KHrIP6NE4dFNWWaLXTYkSovjr/AXMOn747wZaMJIEAjT4BIHQ0xnDO/BoD5U2OqJcrcpzL9Wt9N538SOgLIKgDmFMfuz9t3VBA2TgLNE6CRN8/Mzhqhod8M1SvLj3PttZFPOgNF5M9A9jqeC27nEGRWrROgkbfOzt6a4U5Qs0Z7iqNwO/FEXvNJ/sng6dvLmydwfkiABGoQoJFzWEQTMKtb1F8BSAEiZlnKpE8HjdzsvIT/GCRzNadOOEBJoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE6CR12fEEiRAAiQQawI08ljLw+BIgARIoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE6CR12fEEiRAAiQQawI08ljLw+BIgARIoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE6CR12fEEiRAAiQQawI08ljLw+BIgARIoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE/g/dbAvi6x3vvYAAAAASUVORK5CYII=
我们在更新发布后立即解决了这个问题。我们可以与您分享补丁。能否请您发送电子邮件至 cf.install@adobe.com.
谢谢,
普里扬克
如何将此 base64 图像从 jsignature 保存到透明 ping?我以前可以成功保存透明背景的图像,现在只能保存黑色背景。我不确定在最近的两个 ColdFusion 或 Java 更新之一之后出现了什么问题。 (我是 运行 Cold Fusion 2016 update 10)图像数据通过表单字段传入 local.signaturedata & POST。
<cfimage action="read" source="#imageReadBase64(local.signaturedata)#" name="local.imgCanvas"> <!--- png --->
<cfset ImageResize(local.imgCanvas,"",local.height)> <!--- png --->
<cfset local.bimg = imageGetBufferedImage(local.imgCanvas)>
<!--- RGB --->
<cfset local.rCS = createObject("java","java.awt.color.ColorSpace").CS_sRGB><!--- PROD: CS_sRGB, TEST: CS_LINEAR_RGB, TYPE_RGB, TYPE_INT_ARGB --->
<cfset local.rgb = createObject("java","java.awt.color.ColorSpace").getInstance(local.rCS)>
<cfset local.convert = createObject("java","java.awt.image.ColorConvertOp").init(local.rgb,javaCast("null",""))>
<cfset local.newImage = local.convert.filter(local.bimg, javaCast("null",""))>
<cfset local.imgCanvasConverted = imageNew(local.newImage)><!--- PROD: imageNew(local.newImage) --->
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXIAAABdCAYAAAC4qe1eAAANZ0lEQVR4Xu2de4xcZRnGn3emlG2gXOTWKLBnBcUAQqsVhEKgRNmZIbFF+EOMpCXGEGlQjBeMUS7BREQRSgEJwbQkhGgo0EaZs4VoCwgmBqFIScql7NmWUmyQS4m0ZbvnNd85O92dy9m57cyc851nkqZJ57u87+/59unZ73wXAT8kQAIkQAKJJiCJjp7BkwAJkAAJgEbOQUACJEACCSdAI0+4gAyfBEiABGjkHAMkQAIkkHACNPKEC8jwSYAESIBGzjFAAiRAAgknQCNPuIAMnwRIgARo5BwDJEACJJBwAjTyhAvI8EmABEiARs4xQAIkQAIJJ0AjT7iADJ8ESIAEaOQcAyRAAiSQcAI08oQLyPBJgARIgEbOMUACJEACCSdAI0+4gD0N33EdQBYDeiaAzdWxyBzAByBvV3zXB+jnIJnnMZy7qac5sHMSsIAAjdwCEbuWgjN0M+CfBMhhgM4N/27zI/oxNHM3oMvh5b02W2N1EkglARp5KmVvMmnn8bnA2F8BfKLJms0W3wzB49C+6+EtfL/ZyixPAmklQCNPq/KN5u24awAsii6uZuok4utWvzPN6UaI7AQyT0Fn3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e+wE02UJp6kT8q2rOe0/dHA28SdwsnkwCNPJk6tZe1IE5wmwYOrSphgTPQfVNQEzdSR+dA2TM0r63q9ur9d1U5UstyFyIHgvF/PBfoq6rL4sjfO0TvtS8H+i7hrsym1KYhRNKgEaeUOHaDju4+WbshQpDnvT+u4Gn9baDaKSBpuJYC+gqeAVeNt0IWpaxhgCN3BopW0jk+KHrIP6NE4dFNWWaLXTYkSovjr/AXMOn747wZaMJIEAjT4BIHQ0xnDO/BoD5U2OqJcrcpzL9Wt9N538SOgLIKgDmFMfuz9t3VBA2TgLNE6CRN8/Mzhqhod8M1SvLj3PttZFPOgNF5M9A9jqeC27nEGRWrROgkbfOzt6a4U5Qs0Z7iqNwO/FEXvNJ/sng6dvLmydwfkiABGoQoJFzWEQTMKtb1F8BSAEiZlnKpE8HjdzsvIT/GCRzNadOOEBJoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE6CR12fEEiRAAiQQawI08ljLw+BIgARIoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE6CR12fEEiRAAiQQawI08ljLw+BIgARIoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE6CR12fEEiRAAiQQawI08ljLw+BIgARIoD4BGnl9RixBAiRAArEmQCOPtTwMjgRIgATqE/g/dbAvi6x3vvYAAAAASUVORK5CYII=
我们在更新发布后立即解决了这个问题。我们可以与您分享补丁。能否请您发送电子邮件至 cf.install@adobe.com.
谢谢, 普里扬克