Page 1 of 2

Picture file Load and Export

PostPosted: 06 Oct 2016 10:04
by zsleo
Are there methods to Load and Export this component from picture files - PNG and or JPG will be ideal.

I have per the demo v3 example ExportImage to a JQImage and then save from the JQImage. Export to JQImage works fine for me but the save to file form JQImage never results in a saved file.

Any help will be appreciated.

Attached is a small (messy) example project.

TIA

IW_CDG_No_DB.7z

Re: Picture file Load and Export

PostPosted: 10 Oct 2016 01:46
by zsleo
I really need to get this to work.

All help appreciated

TIA

Re: Picture file Load and Export

PostPosted: 10 Oct 2016 17:05
by Alexander Bulei
Hi zsleo,

I have checked your demo, and it work as expected.

Some tips to check:
* Directory exists?
* Have permissions to write in folder?

Best Regards.

Re: Picture file Load and Export

PostPosted: 10 Oct 2016 23:01
by zsleo
Directory exists and permission are correct.

I changed the directory to WebApplication.UserCacheDir and it still does not save the file. The following error is generated

IWBase__ECF8FECF6.js:2 Error in processAjaxExecute when evaluating:
var img = new Image(); var $cgimg = $("#JQWPAINTIMG_IMG"); var src = $cgimg.attr("src"); var canvas = document.createElement("canvas"); var context = canvas.getContext("2d"); img.width = $cgimg.width(); img.height = $cgimg.height(); img.crossOrigin = "anonymous"; img.onload = function() { canvas.width = img.width; canvas.height = img.height; context.drawImage(img, 0, 0, img.width, img.height); var imgDataUrl = canvas.toDataURL("image/png"); imgDataUrl = imgDataUrl.replace(/^data:image\/(png|jpg);base64,/, ""); CGSendLargeDataToUrl([{"value":imgDataUrl,"name":"imageData"},{"value":"C:\\Users\\ZANELE~1.ADE\\AppData\\Local\\Temp\\01b10q8m08\\user\\Z~elvCByfegw2jrTMkm3qq\\567.png","name":"filename"}],"/IWCGJQ/IDD232C8F8C8C1428DA820B58F41630893ActionGetImageDataUrl"); } img.src = src;
Unexpected identifier


I do not know JScript well enough but a JScript verifier on google suggests that right at the end of the script "; } img.src = src;" should be "; }; img.src = src;"

Regards

Re: Picture file Load and Export

PostPosted: 11 Oct 2016 11:34
by Alexander Bulei
Hi zsleo,

Yeah, you are right!
Its happens when Debug = False

Fixed. Thank you.

Best Regards.

Re: Picture file Load and Export

PostPosted: 11 Oct 2016 13:25
by zsleo
Thanks Alexander,

Does this mean I have to wit for next release?

.. and are you saying that switching debug on will fix it in the short term


TIA

Re: Picture file Load and Export

PostPosted: 11 Oct 2016 14:04
by Alexander Bulei
Hi,

Does this mean I have to wit for next release?


Yes

.. and are you saying that switching debug on will fix it in the short term


Yes


Best Regards.

Re: Picture file Load and Export

PostPosted: 12 Oct 2016 11:31
by zsleo
Okay... more issues for me.

1.
IWCGJQWPaint.JQWPaintOptions.Image := 'files/page.png' ==>> {D:\inetpub\MSQL\wwwroot\Files\page.png}

is inconsistant wih

JQwPaintImg.SaveImage('files/page.png') ==>> {D:\inetpub\MSQL\Files\page.png}

I have a db that manages PNG image files. Creating new images and saving them using these two components via a saved file is work as expected.

My problem is redisplaying the file into IWCGJQWPaint is just not happening for me. Here are my finding.

2.
IWCGJQWPaint.JQWPaintOptions.Image := 'D:\inetpub\MSQL\wwwroot\Files\page.png'
Not allowed to load local resource: file:///D:/inetpub/MSQL/wwwroot/Files/page.png

3.
IWCGJQWPaint.JQWPaintOptions.Image := 'files/page.png'
No errors but does not display the image

4.
IWCGJQWPaint.JQWPaintOptions.Image := 'wwwroot/files/page.png' -> http://127.0.0.1:4081/$/wwwroot/files/page.png
Failed to load resource: the server responded with a status of 404 (Not Found) <<== but it does exist in both D:\inetpub\MSQL\wwwroot\Files\page.png and D:\inetpub\MSQL\Files\page.png


More help needed.

Regards

Re: Picture file Load and Export

PostPosted: 12 Oct 2016 16:34
by Alexander Bulei
Hi,

In ISAPI or SA?

Best Regards.

Re: Picture file Load and Export

PostPosted: 12 Oct 2016 20:18
by zsleo
Definitely in SA. Have not yet tested ISAPI.