/* gcc gexiv2-fnumber-focal-length.c $(pkg-config --cflags --libs
   gexiv2 glib-2.0) */

#include <gexiv2/gexiv2.h>
#include <glib.h>

static const gchar *FILE_PATH = "no-fnumber.jpg";

gint
main (void)
{
  GExiv2Metadata *metadata;
  double fnumber;
  double focal_length;

  metadata = gexiv2_metadata_new ();

  {
    g_autoptr (GError) error = NULL;

    if (!gexiv2_metadata_open_path (metadata, FILE_PATH, &error))
      {
        g_warning ("gexiv2_metadata_open_path: %s", error->message);
        goto out;
      }
  }

  fnumber = gexiv2_metadata_get_fnumber (metadata);
  g_message ("fnumber: %f", fnumber);

  focal_length = gexiv2_metadata_get_focal_length (metadata);
  g_message ("focal_length: %f", focal_length);

 out:
  return 0;
}
