LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to add info to png header?

Hi
I'm interested in adding some info into the header of a png file and I have no idea how to start.
The info I'm thinking of adding to the header might be the date the image was acquired, who acquired it etc...

I'm using Labview 7.1

Thanks,
S

0 Kudos
Message 1 of 10
(8,875 Views)

Hi sau,

I found this sample ZIP file that contains a VI for writing header information to a PNG file.  I don't know anything about how the DLL was implemented that does this, but I just tried it out in LabVIEW 8.0 and it seems to work (the VIs were actually written in LabVIEW 6.1).  I hope this can help you.

-D

0 Kudos
Message 2 of 10
(8,872 Views)
Hi D,
Thanks for the vis, they are exactly what I need!!

Anyone know what the "text in" variable does?  The contents of that variable, doesn't appear to write to the png file unlike the "header in" variable.

S

0 Kudos
Message 3 of 10
(8,859 Views)

I think when you write the "text in" parameter, you also specify an "index" as to where you want that text to go.  Then when you read the PNG file, you specify an "index" as to which text you want to read, and it returns the text that you previously wrote to that index.  From my understanding, it's a way to store more information in the file if you can't fit everything you want in the 64-byte header.

-D

0 Kudos
Message 4 of 10
(8,855 Views)
I downloaded and used this Write PNG Header, and it works well, but is a very slow vi.  It takes nearly 0.5 seconds to execute once and write one text header line to a png file.

Does anyone have a better and faster solution?

Thanks,
Deborah
0 Kudos
Message 5 of 10
(8,830 Views)

Hi Deborah,

I don't know of any other solution out there...did you mass compile the VIs before using them?  Mass compiling will often help with loading, and sometimes the performance, of VIs saved in older versions.

-D

0 Kudos
Message 6 of 10
(8,825 Views)
I tried mass compiling, and that didn't help.  When I simplify the code to just calling the dll and returning, it is still slow.  The dll is the lag, and I don't know any way to speed it up.  Do you know any other method to write header information to a png file?

I can add the same information at the end of the file just appending data chucks and it only takes about 4 ms, but I would rather use the standard png chuck structure so that any external png viewer can read the information I am trying to add.

Thanks,
Deborah
0 Kudos
Message 7 of 10
(8,813 Views)

Hi Deborah,

I don't know of any way to write the PNG header information other than that VI.  Perhaps you can find a freeware DLL or ActiveX control on the web somewhere that you could interface with LabVIEW that might be faster than this example program.

Is there any reason you need this to be particularly fast?  Generally, non-streaming file I/O operations aren't meant to be all that fast.

Good luck,
-D

0 Kudos
Message 8 of 10
(8,806 Views)
Hi,
im using this writting mecaism to, but does anyone know where visual assistant stores calibration information within the .png image?
i can't find it!
chears, was just hoping that you had a simular issue.
John P.
0 Kudos
Message 9 of 10
(8,560 Views)
double post! (question is slightly changed...)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(8,541 Views)