Converting Lat / Long GPS coordinates to an EXIF Rational byte array
===

I am having problems converting GPS coordinates to a byte array that can be stored as EXIF information.

[This questions][1] states that EXIF coordinates should be expressed as three rational numbers: `degrees/1, minutes/1, seconds/1`. I'm having no trouble converting a decimal coordinate to that. For example `42.1234567` is easily converted to `42/1, 7/1, 24/1`.

My problem is that I don't understand how to represent this as a byte array when I write it to the image EXIF information. The library that I'm using is called [ExifWorks][2], and I'm using it in VB.NET.

The ExifWorks `setProperty` method takes three things: the EXIF field ID, an array of bytes as data, and the data type. Here's how I use it:

    ew.SetProperty(TagNames.GpsLatitude, byteArrayHere, ExifWorks.ExifDataTypes.UnsignedRational)

I've also tried:

    ew.SetPropertyString(TagNames.GpsLatitude, "42/1, 7/1, 24/1")

Which also doesn't work.

So, my question is, how do I convert my degree-minute-second coordinate into a byte array? Everything I've tried thus far ends up as invalid EXIF information, and doesn't work. A general solution is fine... doesn't necessarily have to work in VB.net.

  [1]: http://stackoverflow.com/questions/5280479/how-to-save-gps-coordinates-in-exif-data-on-android
  [2]: http://www.codeproject.com/Articles/4956/The-ExifWorks-class