How to write pixel size in metadata

Hello,
I have a relatively simple question for which I could not find an answer on the ImageJ listserv or the Bioformats forum.
After taking an image, how can I add the correct metadata on pixel size in order to have it read properly by ImageJ/Bioformats? It does not seem to be enough to change “Exif.Image.XResolution” and “Exif.Image.YResolution”.
I would like to do this for jpg and for tiff.
The background is that I made a small program to remote control the DSLR on a microscope. Since for each objective, pixel size changes, I have to add the actual dimensions accordingly.
Thanks in advance for help.
Johannes
I have a relatively simple question for which I could not find an answer on the ImageJ listserv or the Bioformats forum.
After taking an image, how can I add the correct metadata on pixel size in order to have it read properly by ImageJ/Bioformats? It does not seem to be enough to change “Exif.Image.XResolution” and “Exif.Image.YResolution”.
I would like to do this for jpg and for tiff.
The background is that I made a small program to remote control the DSLR on a microscope. Since for each objective, pixel size changes, I have to add the actual dimensions accordingly.
Thanks in advance for help.
Johannes