LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read jpg files in windows vista

 hi all,

 

 I am having difficulty in reading the .jpg file using windows vista as a operating system.

 

When I am using read jpeg file vi I am getting an error that file path may contain expression not supported by OS.

 

But the path I am provided is like C:\users\desktop\abc.jpg

 

I dont know what is the correct file path format for the jpeg file to read in vista..

 

plz guide me ...

0 Kudos
Message 1 of 12
(4,113 Views)

I doubt that the path is correct, normally the path would be:

 

C:\users\%username%\desktop\abc.jpg

Try to use the File dialog function for the path.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 12
(4,093 Views)

thanks for the reply,

 

but I am using file dialog box only to specify a path from where i can browse to the required file path.

 

Also when i am using the same path in the run option from the start menu of windows image can be seen which means that path is proper,

 

so I am not getting where the exact problem is.

0 Kudos
Message 3 of 12
(4,066 Views)

I find that hard to believe. 
Which version of Vista are you using?  As Ton said, the username is a part of the path.

 

Can you post the VI so we can see how you are specifying the path?

 

Have you tried reading the file from another location such as the c:\ drive (assuming you have the user rights to place the file there) or the documents directory to see if that works?

0 Kudos
Message 4 of 12
(4,056 Views)

shruthi,

 

can you verify once that the "abc.jpg" file is actually a "jpg" file and not a .png or .bmp file?

There are chances that the file extension might have changed and the the LV vi can not read it

 

Guru

Regards
Guru (CLA)
0 Kudos
Message 5 of 12
(4,043 Views)

Guruthilak wrote:

shruthi,

 

can you verify once that the "abc.jpg" file is actually a "jpg" file and not a .png or .bmp file?

There are chances that the file extension might have changed and the the LV vi can not read it

 

Guru


That's another good option.

Could you show your VI and/or upload the jpg?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 12
(4,037 Views)

yes,the file which i m using is of .jpg only.

 

here i m attching the vi along with the image file.

 

when same image file was converted into .png format and i replaced "read jpeg file"function by "read png file" function i was able to see the image. 

Download All
0 Kudos
Message 7 of 12
(3,995 Views)

I'm using LV2009f2 on Vista Home Premium.  I saved your jpeg to my desktop.  I used the browse button on the file path control and selected the file.  I ran the VI.  The picture loaded in the picture indicator just fine without any errors.  See the attached .png.


What are you doing differently?  Put an indicator on the boolean that is coming out of the check if file or folder exists.vi to see if the True or False case of your Select function is executing.

 

As you can see, the path includes my username as part of the file path to my desktop.

 

Can you post a screenshot of your front panel after you run it?

 

 

0 Kudos
Message 8 of 12
(3,988 Views)

I have the exact same problem on a Vista machine. The user path is irrelavent. I think this is a bug:

 

Import the jpeg into powerpoint and save as jpeg with a different name -> same error: illegal character in path

 

Import the jpeg into poweroint and save as png with a different name in same directory. Change read vi to "read png file" works fine!

 

Ok NI, what's going on?

0 Kudos
Message 9 of 12
(3,765 Views)

What version of Windows Vista and what version of LabVIEW are you using?

 

You say you imported the picture into powerpoint, and did a Save as jpeg.  How do you do a save as jpeg with an imported picture in powerpoint?  I don't know of any Save As for handling imported picture objects in Powerpoint.

 

 

Unfortunately, the original poster never bothered to come back and give us any more information and answer the questions  I asked.

Message Edited by Ravens Fan on 03-05-2010 03:59 PM
0 Kudos
Message 10 of 12
(3,746 Views)