LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 6 occurred at Read PNG File.vi

Solved!
Go to solution

I have a program that loads .PNG files and dislpays them to the user.  I have 50+ files that load fine, all of which are less then 10kB.  I have a few files that will not load and they are slightly over 20kB.  

 

When I us the "Read PNG.vi" it throws the following error: "Error 6 occurred at Read PNG File.vi"

 

 Is there an issue with the "Read PNG.vi" that will not allow it to load larger PNG Files?  Is there another way I can get the Image Data out of a PNG file without using the "Read PNG.vi"?

 

I have attached 2 .PNG files

1.) "Does Not Load.PNG"  (This file does not load with the "Read PNG.vi" and is 23kB)

2.) "Loads.PNG" (This file loads fine with the "Read PNG.vi" and is 3kB)

 

I need to learn how to get the image data from the file that will not load.

 

Thanks

 

Brian 

Download All
0 Kudos
Message 1 of 4
(4,310 Views)
Solution
Accepted by topic author Siriusly

The PNG file that is not loading is not actually a PNG file thats a JPEG file. So Open that file in mspaint and save it as .PNG and then try reading it. You can check the same thing with the other files that is not loading. If you have doubt use the function Read JPEG file.vi and check it.

-----

The best solution is the one you find it by yourself
Message 2 of 4
(4,307 Views)

 

 

I was given these files and assumed they were all .PNG's since the extensions were all PNG and they opened with Microsoft Picure Manager witout errors.  How did you know they were JPG's so quick? Experience? Or could you tell by some other means...

 

Thanks

0 Kudos
Message 3 of 4
(4,302 Views)

Ha ha ha.. Just a common sense Smiley Wink.. I tried saving the file to my desktop and it gave me jpeg extension.. Try it just try saving the file you posted.Smiley LOL

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 4
(4,298 Views)