I reviewed Trouble converting png to jpg
But It seems to be occurring still or again.The below works, but if the file being written is a jpg, then it writes, but as a 0kb file. The image does not upload.
I can change my cfdocuments to use png, but was hoping to not have to do that .
Also, tried using convert and will create teh jpg, but still as 0kb.
Windows server 2016 Lucee 5.3.5.92
@Zackster, just updated but Windows Server 2016 Lucee 5.3.5.92
Image Extension is 1.0.0.35
If I go to the file server and look at the image if it is a gif or jpg, it shows as 0KB file with nothing displaying.
If I use png the file displays properly. This is a signature that displays on a document.Using canvas to capture the signature.
Does anyone have a workaround in the meantime?
PNG’s while they do create, come out extremely light and have tried many variations. This will be a huge hold up in moving to lucee.
We actually figured out a work around for us.
Looping through and making sure the color was set to actual black and then saving as a jpg on client side instead of server side. Then when you upload to server in Lucee it does write as a jpg
for (i=3;i<iData.data.length;i+=4){
//if the opacity is 0 change the color to white:
if (iData.data[i] == 0) {
iData.data[i-1]=255;
iData.data[i-2]=255;
iData.data[i-3]=255;
}
//Change opacity to 100% for everything:
iData.data[i]=255;
}
this.canvas.hide();
this.context.putImageData(iData,0,0);
var dataString = this.canvas.get(0).toDataURL("image/jpeg");
var index = dataString.indexOf( "," )+1;
dataString = dataString.substring( index );