OK, I understand the issue I think.
SmallBasicLibrary uses Network.DownloadFile for all network file access, including within ImageList.LoadImage.
The code for DownloadFile includes this to read the data:
This fails for Flickr image urls as we know, using Network.DownloadFile or ImageList.LoadImage.
The code I use in LDBasic.DownloadFile is slightly different (apart from the SSL stuff):
So SmallBasicLibrary tests webResponse.ContentLength to check size. Google 'webResponse.ContentLength' if interested.
The documentation for it states:
So, this is an 'optional' setting included in the web response header (not set by Flikr, probably changed at some point). Standard SmalBasicLibrary cannot work for web urls that don't have this property set.
SmallBasicLibrary uses Network.DownloadFile for all network file access, including within ImageList.LoadImage.
The code for DownloadFile includes this to read the data:
Code:
long num = webResponse.ContentLength;
stream2 = webResponse.GetResponseStream();
while (num > 0)
{
int num2 = stream2.Read(buffer, 0, 16384);
stream.Write(buffer, 0, num2);
num -= num2;
}
This fails for Flickr image urls as we know, using Network.DownloadFile or ImageList.LoadImage.
The code I use in LDBasic.DownloadFile is slightly different (apart from the SSL stuff):
Code:
Stream stream = webResponse.GetResponseStream();
int readCount = stream.Read(buffer, 0, bufferSize);
while (readCount > 0)
{
fs.Write(buffer, 0, readCount);
readCount = stream.Read(buffer, 0, bufferSize);
}
So SmallBasicLibrary tests webResponse.ContentLength to check size. Google 'webResponse.ContentLength' if interested.
The documentation for it states:
Quote:The ContentLength property contains the value of the Content-Length header returned with the response. If the Content-Length header is not set in the response, ContentLength is set to the value -1.
So, this is an 'optional' setting included in the web response header (not set by Flikr, probably changed at some point). Standard SmalBasicLibrary cannot work for web urls that don't have this property set.