I am modifying jpeg EXIF data. Some data requires to be defined as a fractions.
Here, I have two problems:
1.) Which is the correct fraction “format”? For instance when I have an exposure time (“ExposureTime”) of 30000µs and store it as 30000/1000000 the EXIF viewer shows the wrong exposure. Storing as “1/30” returns the correct result. Do all fractions have to be “1/x”?
2.) How can I calculate the fraction fast? The method I am using now (similar to “Dec2Frac” in [1]) is very slow.
Regards,
This is the code I have used in C# for calculating a fraction for EXIF GPS data. The method returns an array of two integers – one being the numerator and one the denominator.