LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

download picture from web

Hello everybody,

I want to load a picture from the internet and used normal TCP-commands (TCPOpen, 'Get', TCPRead). Last week I found the following article (with vi):
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/b92648089952cdd386256d0f00792187?OpenDocument

But now I'm stucked:
When the internet address starts with "http://www."  then LabView gets the picture. When the internet address starts with a different name (i.e. not "www") LabView cannot find the picture even when the address uses the http-protocol ("http://images.chron.com/apps/comics/images/2005/12/5/Dilbert.133.g.gif" :-)

What to do?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 1 of 5
(3,226 Views)
The downloading works fine for me - LV does get the file data and displays it in the string. The problem then is that it can't open a GIF file, because LV doesn't support GIF inherently (although there is a Write GIF VI which is shipped with LV). I think George Zou has VIs which read GIF. Try looking at his site.

___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,215 Views)

Hi GerdW, tst

I just tried the vi which is available in the thread mentioned by GerdW. Passing the url of the gif-file, I also don't get a picture, but not because of the file format. There is no data read.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 3 of 5
(3,211 Views)
Hello Thomas,

yes there is no data read. But in IE (or FireFox or whatever) this url gives me the picture...
Actually I did 'copy & paste' the url from explorer to LabView. Normally I load the webpage ('http://www.chron.com/apps/comics/showComic.mpl?date=2005/12/5&name=Dilbert'), parse the html to get the url of the pic and save the pic. This is broken since 'www.chron.com' changed their picture server to 'images.chron.com'.
So I wonder why LabView can't find the url when IE can?

Update: Now LabView finds the picture data (as tst also said). In the morning I got an error 1184... Interesting ;-|

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,205 Views)

Hi All,

      JPG_to_picture didn't like this URL

http://images.chron.com/apps/comics/images/2005/12/5/Dilbert.133.g.gif

(Datasocket Read produces an error - nothing returned), but data was returned with the following URL

 
.. of course one would still have to deal with the GIF.text (like tst already said)
 

Message Edited by Dynamik on 12-06-2005 03:19 AM

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 5 of 5
(3,186 Views)