ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 LoadFromURL black rectangle
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

adyble

United Kingdom
14 Posts

Posted - Jul 14 2025 :  04:59:16  Show Profile  Reply
Hello

We generate a URL to send to an image web service. The URL works fine in a browser but displays as a black rectangle using -

imageEnView1.io.loadFromUrl(TIdURI.URLEncode(strChartURL));

strChartURL is a side string of approx. 2500 characters. The issue only started when we increased the length of the URL.

imageEnView1.io.loadFromUrl(strChartURL); returns nothing.

The URL is -

https://quickchart.io/chart?bkg=%23fefafa&c={"type":"pie","data":{"datasets":[{"data":[1.86,23.6],"fill":false,"spanGaps":false,"lineTension":0.4,"pointRadius":3,"pointHoverRadius":3,"pointStyle":"circle","borderDash":[0,0],"barPercentage":0.9,"categoryPercentage":0.8,"type":"pie","label":"Dataset1","borderColor":"%234E79A7","backgroundColor":["%234E79A7","%23F28E2B"],"borderWidth":3,"hidden":false}],"labels":["170102Wood","170904MixedConstruction"]},"options":{"title":{"display":true,"position":"top","fontSize":20,"fontFamily":"sans-serif","fontColor":"%23666666","fontStyle":"bold","padding":10,"lineHeight":1.2,"text":"WasteBreakdown"},"layout":{"padding":{},"left":0,"right":0,"top":0,"bottom":0},"legend":{"display":true,"position":"right","align":"start","fullWidth":false,"reverse":false,"labels":{"fontSize":12,"fontFamily":"sans-serif","fontColor":"%23666666","fontStyle":"normal","padding":10}},"scales":{"xAxes":[{"id":"X1","display":false,"position":"bottom","type":"category","stacked":false,"offset":false,"time":{"unit":false,"stepSize":1,"displayFormats":{"millisecond":"h:mm:ss","second":"h:mm:ss","minute":"h:mm","hour":"hA","day":"MMMD","week":"ll","month":"MMMYYYY","quarter":"[Q]Q-YYYY","year":"YYYY"}},"distribution":"linear","gridLines":{"display":true,"color":"rgba(0,0,0,0.1)","borderDash":[0,0],"lineWidth":1,"drawBorder":true,"drawOnChartArea":true,"drawTicks":true,"tickMarkLength":10,"zeroLineWidth":1,"zeroLineColor":"rgba(0,0,0,0.25)","zeroLineBorderDash":[0,0]},"angleLines":{"display":true,"color":"rgba(0,0,0,0.1)","borderDash":[0,0],"lineWidth":1},"pointLabels":{"display":true,"fontColor":"%23666","fontSize":10,"fontStyle":"normal"}, "ticks":{"display":true,"fontSize":12,"fontFamily":"sans-serif","fontColor":"%23666666","fontStyle":"normal","padding":0,"stepSize":null,"minRotation":0,"maxRotation":50,"mirror":false,"reverse":false},"scaleLabel":{"display":false,"labelString":"Axislabel","lineHeight":1.2,"fontColor":"%23666666","fontFamily":"sans-serif","fontSize":12,"fontStyle":"normal","padding":4}}],"yAxes":[]},"plugins":{"datalabels":{"display":false,"align":"center","anchor": "center","backgroundColor":"%23eee","borderColor":"%23ddd","borderRadius":6,"borderWidth":1,"padding":4,"color":"%23666666","font":{"family":"sans-serif","size":10,"style":"normal"}},"datalabelsZAxis":{"enabled":false},"googleSheets":{},"airtable":{},"tickFormat":""},"cutoutPercentage":10,"rotation":-1.5707963267948966,"circumference":6.283185307179586,"startAngle":-1.5707963267948966}}

xequte

39097 Posts

Posted - Jul 15 2025 :  02:39:57  Show Profile  Reply
Sorry, I'm not sure why that is failing. We are just using Windows API calls to handle internet downloads, and this URL fails to return valid content.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

adyble

United Kingdom
14 Posts

Posted - Jul 15 2025 :  05:04:03  Show Profile  Reply
HI

The object is valid if pasted into a browser.
Go to Top of Page

xequte

39097 Posts

Posted - Jul 15 2025 :  21:21:33  Show Profile  Reply
Hi

No, not if you use Internet Explorer to open it (which will be using the same Windows API calls). With Internet Explorer the URL gets truncated to 2084 characters and you get the error:

Chart error: Unexpected token '%' 1:1536

You can reproduce this by running Microsoft Edge in Internet Explorer mode.


Edit: Actually, I see it is documented here:

https://support.microsoft.com/en-us/topic/maximum-url-length-is-2-083-characters-in-internet-explorer-174e7c8a-6666-f4e0-6fd6-908b53c12246


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

39097 Posts

Posted - Jul 15 2025 :  22:45:45  Show Profile  Reply
You should use a different method to download to a stream or temp file, and then load from that.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: