summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/metadata/TODO28
-rw-r--r--ext/metadata/metadata_mapping.htm340
-rw-r--r--ext/metadata/metadataexif.c723
-rw-r--r--ext/metadata/metadatatags.c69
-rw-r--r--ext/metadata/metadatatags.h19
5 files changed, 1075 insertions, 104 deletions
diff --git a/ext/metadata/TODO b/ext/metadata/TODO
index 62ad06d8..e028df46 100644
--- a/ext/metadata/TODO
+++ b/ext/metadata/TODO
@@ -3,7 +3,8 @@ This file contains a list of things to be done as well some open issues (questio
INFO:
-1- to see what tags are mapped so far run 'grep -n GST_TAG *.[ch]' into this folder.
+1- To see the list of tags current mapped:
+ http://webcvs.freedesktop.org/gstreamer/gst-plugins-bad/ext/metadata/metadata_mapping.htm?view=co
TODO:
@@ -12,6 +13,9 @@ TODO:
3- Review the code (in order to move to gst-plugins-good)
4- Document how the plugin works (atchitecture and interaction beteween modules)
5- Improve the test application (to save also in png and to make it possible to set the metadata elements properties)
+6- Implement GDateTime support in GLib to be used by GStreamer (http://bugzilla.gnome.org/show_bug.cgi?id=50076)
+7- Use a standard GStreamer Data-Time type to map our Data-time tags
+8- Make the correct merge mode for multiple value tags (bag and seq) like dc:creator, ...
OPEN ISSUES:
@@ -23,26 +27,32 @@ OPEN ISSUES:
4- Add GST_TYPE_FRACTION support for GStreamer TAGS
5- currently, in JPEG files, if there is a Photoshop segment, everything inside it but IPTC will be lost. From the point of view of implementation it is easy, but I still don't now how to solve from the point of view of "designing". Anyway I think it is not so important.
6- language is not considered in XMP (How to do it with GStreamer?)
-7- Add a helper function that convert from value to string. For example, aperture-size is 2.7 and the app wants to show "f/2.7", 'contrast' is a range and the app wants to show as "Normal", "Soft", "Hard". For the time being it is up to the APP to make this conversion.
+7- Add a helper function that convert from value to string. For example,
+aperture-size is 2.7 and the app wants to show "f/2.7", 'contrast' is a range
+and the app wants to show as "Normal", "Soft", "Hard". For the time being it is
+up to the APP to make this conversion.
LINKS IN BUGZILA
1- to move to good
-http://bugzilla.gnome.org/show_bug.cgi?id=513182
+ http://bugzilla.gnome.org/show_bug.cgi?id=513182
2- Proposal of new tags
-http://bugzilla.gnome.org/show_bug.cgi?id=482947
+ http://bugzilla.gnome.org/show_bug.cgi?id=482947
+ http://bugzilla.gnome.org/show_bug.cgi?id=481169
3- Discussion about the architecture
-http://bugzilla.gnome.org/show_bug.cgi?id=486659
+ http://bugzilla.gnome.org/show_bug.cgi?id=486659
4- Also extraction image width and height and set caps properly
-http://bugzilla.gnome.org/show_bug.cgi?id=503616
+ http://bugzilla.gnome.org/show_bug.cgi?id=503616
KNOWN BUGS
bugs in libexif:
-https://sourceforge.net/tracker/?func=detail&atid=112272&aid=1884609&group_id=12272
+1- https://sourceforge.net/tracker/?func=detail&atid=112272&aid=1884609&group_id=12272
-1- EXIF_TAG_ISO_SPEED_RATINGS should be in EXIF_IFD_EXIF
-2- EXIF_TAG_ISO_SPEED_RATINGS is not inserted anyway
+ a- EXIF_TAG_ISO_SPEED_RATINGS should be in EXIF_IFD_EXIF
+ b- EXIF_TAG_ISO_SPEED_RATINGS is not inserted anyway
+2- EXIF_TAG_FLASH can't be written from the scratch
+3- GST_TAG_CAPTURE_COLOR_SPACE can't be written from the scratch
diff --git a/ext/metadata/metadata_mapping.htm b/ext/metadata/metadata_mapping.htm
index 4c5508ae..64c14d1c 100644
--- a/ext/metadata/metadata_mapping.htm
+++ b/ext/metadata/metadata_mapping.htm
@@ -7,7 +7,10 @@
<META NAME="AUTHOR" CONTENT="Edgard Lima">
<META NAME="CREATED" CONTENT="20080131;12581600">
<META NAME="CHANGEDBY" CONTENT="Edgard Lima">
- <META NAME="CHANGED" CONTENT="20080207;15491600">
+ <META NAME="CHANGED" CONTENT="20080210;6205000">
+ <META NAME="CHANGEDBY" CONTENT="Edgard Lima">
+ <META NAME="CHANGEDBY" CONTENT="Edgard Lima">
+ <META NAME="CHANGEDBY" CONTENT="Edgard Lima">
<META NAME="CHANGEDBY" CONTENT="Edgard Lima">
<META NAME="CHANGEDBY" CONTENT="Edgard Lima">
<!-- -->
@@ -197,29 +200,32 @@
</TR>
<TR VALIGN=TOP>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ <P CLASS="western" ALIGN=CENTER><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_CAPTURE_COLOR_SPACE</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_CAPTURE_COLOR_SPACE</FONT></FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;capture-color-space&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">&quot;capture-color-space&quot;</FONT></FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_UINT</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_UINT</FONT></FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">1-
- sRGB;<BR>0xFFFF - Uncalibrated</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">1-
+ sRGB;<BR>0xFFFF - Uncalibrated</FONT></FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_COLOR_SPACE</FONT></P>
+ <P CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0.5cm"><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_COLOR_SPACE</FONT></FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">BUG
+ in libexif. Can't be created in a exif data created from the
+ scratch</FONT></FONT></P>
</TD>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ <P CLASS="western" ALIGN=CENTER><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></FONT></P>
</TD>
<TD WIDTH=10% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ <P CLASS="western" ALIGN=CENTER><FONT COLOR="#ff0000"><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
@@ -321,7 +327,7 @@
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">0-
- Auto exposure;<BR>1- Manual exposure;<BR>2- Auto bracket (the
+ Auto exposure;<BR>1- Manual exposure;<BR>2- Auto bracket (the
camera shoots a series of frames of the same scene at different
exposure settings)</FONT></P>
</TD>
@@ -602,8 +608,7 @@
</TR>
<TR VALIGN=TOP>
<TD WIDTH=13%>
- <P CLASS="western" ALIGN=CENTER><BR>
- </P>
+ <P CLASS="western" ALIGN=CENTER>-</P>
</TD>
<TD WIDTH=14%>
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_CAPTURE_ORIENTATION</FONT></P>
@@ -782,20 +787,28 @@
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DEVICE_MAKE</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DATE_TIME_DIGITIZED</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;device-make&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;date-time-digitized&quot;</FONT></P>
</TD>
<TD WIDTH=11%>
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">The
- manufacturer of the recording equipment</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Date/Time
+ of image digitized<BR>formated as <A HREF="http://www.w3.org/TR/1998/NOTE-datetime-19980827">subset
+ of ISO RFC
+ 8601</A>:<BR>YYYY<BR>YYYY-MM<BR>YYYY-MM-DD<BR>YYYY-MM-DDThh:mmTZD<BR>YYYY-MM-DDThh:mm:ssTZD<BR>YYYY-MM-DDThh:mm:ss.sTZD<BR>where:<BR>YYYY
+ = four-digit year;<BR>MM = two-digit month (01=January);<BR>DD =
+ two-digit day of month (01 through 31);<BR>hh = two digits of hour
+ (00 through 23);<BR>mm = two digits of minute (00 through 59);<BR>ss
+ = two digits of second (00 through 59);<BR>s = one or more digits
+ representing a decimal fraction of a second;<BR>TZD = time zone
+ designator (Z or +hh:mm or -hh:mm)</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_MAKE</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_DATE_TIME_DIGITIZED</FONT></P>
</TD>
<TD WIDTH=13%>
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
@@ -809,21 +822,131 @@
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DEVICE_MODEL</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DATE_TIME_MODIFIED</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;device-model&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;date-time-modified&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Date/Time
+ of image was last modified<BR>the same format as
+ GST_TAG_DATE_TIME_DIGITIZED</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_DATE_TIME</FONT></P>
+ </TD>
+ <TD WIDTH=13% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=10% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DATE_TIME_ORIGINAL</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;date-time-original&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Date/Time
+ of original image taken<BR>the same format as
+ GST_TAG_DATE_TIME_DIGITIZED</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_DATE_TIME_ORIGINAL</FONT></P>
+ </TD>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=10%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DEVICE_MAKE</FONT></P>
+ </TD>
+ <TD WIDTH=11% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;device-make&quot;</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">The
- model name or model number of the equipment</FONT></P>
+ manufacturer of the recording equipment</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_MAKE</FONT></P>
+ </TD>
+ <TD WIDTH=13% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=10% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DEVICE_MODEL</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;device-model&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">The
+ model name or model number of the equipment</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_MODEL</FONT></P>
</TD>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=10%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_EXIF_MAKER_NOTE</FONT></P>
+ </TD>
+ <TD WIDTH=11% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;exif-maker-note&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TYPE_BUFFER</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Camera
+ private data</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_MAKER_NOTE</FONT></P>
+ </TD>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
@@ -836,20 +959,20 @@
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_HEIGHT</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_GPS_ALTITUDE</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-height&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;gps-altitude&quot;</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_UINT</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TYPE_FRACTION</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Image
- height in pixels</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Altitude
+ (positive means abive sea and negative bellow sea)</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_PIXEL_Y_DIMENSION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_GPS_ALTITUDE</FONT></P>
</TD>
<TD WIDTH=13%>
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
@@ -863,20 +986,76 @@
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_WIDTH</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_GPS_LATITUDE</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-width&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;gps-latitude&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Latitude
+ in the same format as specified in XMP:<BR>&quot;DDD,MM,SSk&quot;
+ or &quot;DDD,MM.mmk&quot;<BR>D- degrees<BR>M- minutes<BR>S-
+ seconds<BR>k- 'N', 'S', 'E', 'W' (North, South, East, West)</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_GPS_LATITUDE</FONT></P>
+ </TD>
+ <TD WIDTH=13% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=10% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_GPS_LONGITUDE</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;gps-longitude&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Longitude.
+ The format is the sames as GST_TAG_GPS_LATITUDE</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_GPS_LONGITUDE</FONT></P>
+ </TD>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=10%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=14% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_HEIGHT</FONT></P>
+ </TD>
+ <TD WIDTH=11% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-height&quot;</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_UINT</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Image
- width in pixels</FONT></P>
+ height in pixels</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_PIXEL_X_DIMENSION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_PIXEL_Y_DIMENSION</FONT></P>
</TD>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
@@ -890,21 +1069,20 @@
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_XRESOLUTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_WIDTH</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-xresolution&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-width&quot;</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TYPE_FRACTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_UINT</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Horizontal
- resolution in pixels per inch.<BR>Here it is always in inches.<BR>In
- EXIF it depends on EXIF_TAG_RESOLUTION_UNIT</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Image
+ width in pixels</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_X_RESOLUTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_PIXEL_X_DIMENSION</FONT></P>
</TD>
<TD WIDTH=13%>
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
@@ -918,21 +1096,21 @@
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_YRESOLUTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_XRESOLUTION</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-yresolution&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-xresolution&quot;</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TYPE_FRACTION</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Vertical
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Horizontal
resolution in pixels per inch.<BR>Here it is always in inches.<BR>In
EXIF it depends on EXIF_TAG_RESOLUTION_UNIT</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_Y_RESOLUTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_X_RESOLUTION</FONT></P>
</TD>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
@@ -943,27 +1121,27 @@
</TR>
<TR VALIGN=TOP>
<TD WIDTH=13%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_COMPOSER</FONT></P>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_IMAGE_YRESOLUTION</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;composer&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;image-yresolution&quot;</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TYPE_FRACTION</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Name
- of the creator of the object, e.g. writer, photographer or graphic
- artist.</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Vertical
+ resolution in pixels per inch.<BR>Here it is always in inches.<BR>In
+ EXIF it depends on EXIF_TAG_RESOLUTION_UNIT</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">EXIF_TAG_Y_RESOLUTION</FONT></P>
</TD>
<TD WIDTH=13%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_BYLINE</FONT></P>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=10%>
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
@@ -971,82 +1149,110 @@
</TR>
<TR VALIGN=TOP>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_COPYRIGHT</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_COMPOSER</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;copyright&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;composer&quot;</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Any
- necessary copyright notice.</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Name
+ of the creator of the object, e.g. writer, photographer or graphic
+ artist.</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_COPYRIGHT_NOTICE</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_BYLINE</FONT></P>
</TD>
<TD WIDTH=10% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT>“<FONT SIZE=1 STYLE="font-size: 8pt">dc:rights”</FONT></P>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=13%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DESCRIPTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_COPYRIGHT</FONT></P>
</TD>
<TD WIDTH=14%>
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=11%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;description&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;copyright&quot;</FONT></P>
</TD>
<TD WIDTH=11%>
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
</TD>
<TD WIDTH=14%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">A
- textual description of the data</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">Any
+ necessary copyright notice.</FONT></P>
</TD>
<TD WIDTH=14%>
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=13%>
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_CAPTION</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_COPYRIGHT_NOTICE</FONT></P>
</TD>
<TD WIDTH=10%>
- <P CLASS="western" ALIGN=LEFT>“<FONT SIZE=1 STYLE="font-size: 8pt">dc:description”</FONT></P>
+ <P CLASS="western" ALIGN=LEFT>“<FONT SIZE=1 STYLE="font-size: 8pt">dc:rights”</FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_TITLE</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_DESCRIPTION</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;title&quot;</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;description&quot;</FONT></P>
</TD>
<TD WIDTH=11% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">A
- shorthand reference for the object.</FONT></P>
+ textual description of the data</FONT></P>
</TD>
<TD WIDTH=14% BGCOLOR="#e6e6ff">
<P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
</TD>
<TD WIDTH=13% BGCOLOR="#e6e6ff">
- <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_OBJECT_NAME</FONT></P>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_CAPTION</FONT></P>
</TD>
<TD WIDTH=10% BGCOLOR="#e6e6ff">
+ <P CLASS="western" ALIGN=LEFT>“<FONT SIZE=1 STYLE="font-size: 8pt">dc:description”</FONT></P>
+ </TD>
+ </TR>
+ <TR VALIGN=TOP>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">GST_TAG_TITLE</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">&quot;title&quot;</FONT></P>
+ </TD>
+ <TD WIDTH=11%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">G_TYPE_STRING</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">A
+ shorthand reference for the object.</FONT></P>
+ </TD>
+ <TD WIDTH=14%>
+ <P CLASS="western" ALIGN=CENTER><FONT SIZE=1 STYLE="font-size: 8pt">-</FONT></P>
+ </TD>
+ <TD WIDTH=13%>
+ <P CLASS="western" ALIGN=LEFT><FONT SIZE=1 STYLE="font-size: 8pt">IPTC_TAG_OBJECT_NAME</FONT></P>
+ </TD>
+ <TD WIDTH=10%>
<P CLASS="western" ALIGN=LEFT>“<FONT SIZE=1 STYLE="font-size: 8pt">dc:title”</FONT></P>
</TD>
</TR>
diff --git a/ext/metadata/metadataexif.c b/ext/metadata/metadataexif.c
index 14527fb6..c5b8f80d 100644
--- a/ext/metadata/metadataexif.c
+++ b/ext/metadata/metadataexif.c
@@ -114,6 +114,7 @@ metadatamux_exif_create_chunk_from_tag_list (guint8 ** buf, guint32 * size,
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <stdio.h>
/*
* enum and types
@@ -124,6 +125,9 @@ typedef struct _tag_MEUserData
GstTagList *taglist;
GstTagMergeMode mode;
ExifShort resolution_unit; /* 2- inches (default), 3- cm */
+ int altitude_ref; /* -1- not specified, 0- above sea, 1- bellow sea */
+ gchar latitude_ref; /* k- not specified, 'N'- north, 'S'- south */
+ gchar longitude_ref; /* k- not specified, 'E'- north, 'W'- south */
} MEUserData;
typedef struct _tag_MapIntStr
@@ -203,17 +207,29 @@ static MapIntStr mappedTags[] = {
{EXIF_TAG_SOFTWARE, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_CREATOR_TOOL /*G_TYPE_STRING*/},
+ {EXIF_TAG_DATE_TIME_DIGITIZED, /*ASCII,*/ EXIF_IFD_EXIF,
+ GST_TAG_DATE_TIME_DIGITIZED /*G_TYPE_STRING*/},
+
+ {EXIF_TAG_DATE_TIME, /*ASCII,*/ EXIF_IFD_0,
+ GST_TAG_DATE_TIME_MODIFIED /*G_TYPE_STRING*/},
+
+ {EXIF_TAG_DATE_TIME_ORIGINAL, /*ASCII,*/ EXIF_IFD_EXIF,
+ GST_TAG_DATE_TIME_ORIGINAL /*G_TYPE_STRING*/},
+
{EXIF_TAG_MAKE, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_DEVICE_MAKE /*G_TYPE_STRING*/},
{EXIF_TAG_MODEL, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_DEVICE_MODEL /*G_TYPE_STRING*/},
+ {EXIF_TAG_MAKER_NOTE, /*UNDEFINED(size any)*/ EXIF_IFD_EXIF,
+ GST_TAG_EXIF_MAKER_NOTE /*GST_TYPE_BUFFER*/},
+
{EXIF_TAG_PIXEL_Y_DIMENSION, /*LONG,*/ EXIF_IFD_EXIF,
- GST_TAG_IMAGE_HEIGHT /*G_TYPE_INT*/}, /* inches */
+ GST_TAG_IMAGE_HEIGHT /*G_TYPE_INT*/},
{EXIF_TAG_PIXEL_X_DIMENSION, /*LONG,*/ EXIF_IFD_EXIF,
- GST_TAG_IMAGE_WIDTH /*G_TYPE_INT*/}, /* inches */
+ GST_TAG_IMAGE_WIDTH /*G_TYPE_INT*/},
{EXIF_TAG_X_RESOLUTION, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_IMAGE_XRESOLUTION /*GST_TYPE_FRACTION*/}, /* inches */
@@ -221,10 +237,24 @@ static MapIntStr mappedTags[] = {
{EXIF_TAG_Y_RESOLUTION, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_IMAGE_YRESOLUTION /*GST_TYPE_FRACTION*/}, /* inches */
+ {EXIF_TAG_GPS_ALTITUDE, /*RATIONAL,*/ EXIF_IFD_GPS,
+ GST_TAG_GPS_ALTITUDE /*GST_TYPE_FRACTION*/},
+
+ {EXIF_TAG_GPS_LATITUDE, /*RATIONAL(3),*/ EXIF_IFD_GPS,
+ GST_TAG_GPS_LATITUDE /*G_TYPE_STRING*/},
+
+ {EXIF_TAG_GPS_LONGITUDE, /*RATIONAL(3),*/ EXIF_IFD_GPS,
+ GST_TAG_GPS_LONGITUDE /*G_TYPE_STRING*/},
+
{0, EXIF_IFD_COUNT, NULL}
};
/* *INDENT-ON* */
+#define IS_NUMBER(n) ('0' <= (n) && (n) <= '9')
+#define IS_FRACT_POSITIVE(n,d) \
+ ( ! ( ((n) >> (sizeof(n)*8-1)) ^ ((d) >> (sizeof(d)*8-1)) ) )
+#define CHAR_TO_INT(c) ((c) - '0')
+
/*
* static helper functions declaration
*/
@@ -244,10 +274,25 @@ static void
metadataparse_exif_content_foreach_entry_func (ExifEntry * entry,
void *user_data);
+static gboolean
+metadataparse_handle_unit_tags (ExifEntry * entry, MEUserData * meudata,
+ const ExifByteOrder byte_order);
+
static void
metadatamux_exif_for_each_tag_in_list (const GstTagList * list,
const gchar * tag, gpointer user_data);
+static gboolean metadataparse_exif_convert_to_datetime (GString * dt);
+
+static gboolean metadatamux_exif_convert_from_datetime (GString * dt);
+
+static gboolean
+metadatamux_exif_convert_from_gps (guint8 * data, const char *lt, char *ref);
+
+static gboolean
+metadataparse_exif_convert_to_gps (const guint8 * data, GString * lt,
+ const int exif_tag, const MEUserData * meudata);
+
/*
* extern functions implementations
*/
@@ -274,7 +319,7 @@ metadataparse_exif_tag_list_add (GstTagList * taglist, GstTagMergeMode mode,
const guint8 *buf;
guint32 size;
ExifData *exif = NULL;
- MEUserData user_data = { taglist, mode, 2 };
+ MEUserData user_data = { taglist, mode, 2, -1, 'k', 'k' };
if (adapter == NULL || (size = gst_adapter_available (adapter)) == 0) {
goto done;
@@ -457,7 +502,7 @@ metadataparse_exif_data_foreach_content_func (ExifContent * content,
{
ExifIfd ifd = exif_content_get_ifd (content);
- if (ifd == EXIF_IFD_0 || ifd == EXIF_IFD_EXIF) {
+ if (ifd == EXIF_IFD_0 || ifd == EXIF_IFD_EXIF || ifd == EXIF_IFD_GPS) {
GST_LOG ("\n Content %p: %s (ifd=%d)", content, exif_ifd_get_name (ifd),
ifd);
@@ -494,23 +539,8 @@ metadataparse_exif_content_foreach_entry_func (ExifEntry * entry,
return;
byte_order = exif_data_get_byte_order (entry->parent->parent);
- if (entry->tag == EXIF_TAG_RESOLUTION_UNIT) {
- meudata->resolution_unit = exif_get_short (entry->data, byte_order);
- if (meudata->resolution_unit == 3) {
- /* if [xy]resolution has alredy been add in cm, replace it in inches */
- gfloat value;
-
- if (gst_tag_list_get_float (meudata->taglist, GST_TAG_IMAGE_XRESOLUTION,
- &value))
- gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
- GST_TAG_IMAGE_XRESOLUTION, value * 0.4f, NULL);
- if (gst_tag_list_get_float (meudata->taglist, GST_TAG_IMAGE_YRESOLUTION,
- &value))
- gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
- GST_TAG_IMAGE_YRESOLUTION, value * 0.4f, NULL);
- }
+ if (metadataparse_handle_unit_tags (entry, meudata, byte_order))
goto done;
- }
if (!tag)
goto done;
@@ -540,6 +570,14 @@ metadataparse_exif_content_foreach_entry_func (ExifEntry * entry,
numerator = (gint) v_rat.numerator;
denominator = (gint) v_rat.denominator;
}
+ if (meudata->altitude_ref == 1) {
+ if (entry->tag == EXIF_TAG_GPS_ALTITUDE) {
+ if (numerator > 0)
+ numerator = -numerator;
+ if (denominator < 0)
+ denominator = -denominator;
+ }
+ }
if (meudata->resolution_unit == 3) {
/* converts from cm to inches */
if (entry->tag == EXIF_TAG_X_RESOLUTION
@@ -558,12 +596,50 @@ metadataparse_exif_content_foreach_entry_func (ExifEntry * entry,
gst_tag_list_add (meudata->taglist, meudata->mode, tag, numerator,
denominator, NULL);
+ } else if (type == GST_TYPE_BUFFER) {
+ GstBuffer *buf = gst_buffer_new_and_alloc (entry->components);
+
+ memcpy (GST_BUFFER_DATA (buf), entry->data, entry->components);
+ gst_tag_list_add (meudata->taglist, meudata->mode, tag, buf, NULL);
+ gst_buffer_unref (buf);
} else {
switch (type) {
case G_TYPE_STRING:
- gst_tag_list_add (meudata->taglist, meudata->mode, tag,
- exif_entry_get_value (entry, buf, sizeof (buf)), NULL);
+ {
+ const gchar *str = exif_entry_get_value (entry, buf, sizeof (buf));
+ GString *value = NULL;
+
+ if (entry->tag == EXIF_TAG_DATE_TIME_DIGITIZED
+ || entry->tag == EXIF_TAG_DATE_TIME
+ || entry->tag == EXIF_TAG_DATE_TIME_ORIGINAL) {
+ value = g_string_new_len (str, 20);
+ /* 20 is enough memory to hold "YYYY-MM-DDTHH:MM:SS" */
+
+ if (metadataparse_exif_convert_to_datetime (value)) {
+ str = value->str;
+ } else {
+ GST_ERROR ("Unexpected date & time format for %s", tag);
+ str = NULL;
+ }
+
+ } else if (entry->tag == EXIF_TAG_GPS_LATITUDE
+ || entry->tag == EXIF_TAG_GPS_LONGITUDE) {
+ value = g_string_new_len (str, 11);
+ /* 21 is enough memory to hold "DDD:MM:SSk" */
+ if (metadataparse_exif_convert_to_gps (entry->data, value,
+ entry->tag, meudata)) {
+ str = value->str;
+ } else {
+ GST_ERROR ("Unexpected date & time format for %s", tag);
+ str = NULL;
+ }
+ }
+ if (str)
+ gst_tag_list_add (meudata->taglist, meudata->mode, tag, str, NULL);
+ if (value)
+ g_string_free (value, TRUE);
+ }
break;
case G_TYPE_INT:
/* fall through */
@@ -630,6 +706,122 @@ done:
}
/*
+ * metadataparse_handle_unit_tags:
+ * @entry: The exif entry that is supposed to have a tag that makes reference
+ * to other tag
+ * @meudata: contains references that can be used afterwards and the tag list
+ * @byte_order: used to read Exif values
+ *
+ * This function tries to parse Exif tags that are not mapped to Gst tags
+ * but makes reference to another Exif-Gst mapped tag. For example,
+ * 'resolution-unit' that says the units of 'image-xresolution', so proper
+ * conversion is done or a hint to the conversion is stored to @meudata
+ * to be used afterwards.
+ *
+ * Returns:
+ * <itemizedlist>
+ * <listitem><para>%TRUE if the @entry->tag was handled
+ * </para></listitem>
+ * <listitem><para>%FALSE if this function does'n handle @entry->tag
+ * </para></listitem>
+ * </itemizedlist>
+ */
+
+static gboolean
+metadataparse_handle_unit_tags (ExifEntry * entry, MEUserData * meudata,
+ const ExifByteOrder byte_order)
+{
+ gboolean ret = TRUE;
+
+ switch (entry->tag) {
+ case EXIF_TAG_RESOLUTION_UNIT:
+ meudata->resolution_unit = exif_get_short (entry->data, byte_order);
+ if (meudata->resolution_unit == 3) {
+ /* if [xy]resolution has alredy been add in cm, replace it in inches */
+ gfloat value;
+
+ if (gst_tag_list_get_float (meudata->taglist,
+ GST_TAG_IMAGE_XRESOLUTION, &value)) {
+ gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
+ GST_TAG_IMAGE_XRESOLUTION, value * 0.4f, NULL);
+ }
+ if (gst_tag_list_get_float (meudata->taglist,
+ GST_TAG_IMAGE_YRESOLUTION, &value)) {
+ gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
+ GST_TAG_IMAGE_YRESOLUTION, value * 0.4f, NULL);
+ }
+ }
+
+ break;
+ case EXIF_TAG_GPS_ALTITUDE_REF:
+ meudata->altitude_ref = entry->data[0];
+
+ const GValue *value = gst_tag_list_get_value_index (meudata->taglist,
+ GST_TAG_GPS_ALTITUDE, 0);
+
+ if (value) {
+ gint n, d;
+
+ n = gst_value_get_fraction_numerator (value);
+ d = gst_value_get_fraction_denominator (value);
+ if (meudata->altitude_ref == 1) { /* bellow sea */
+ if (IS_FRACT_POSITIVE (n, d)) { /* if n * d > 0 */
+ gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
+ GST_TAG_GPS_ALTITUDE, -n, d, NULL);
+ }
+ }
+ }
+
+ break;
+ case EXIF_TAG_GPS_LATITUDE_REF:
+ {
+
+ gchar *value = NULL;
+
+ meudata->latitude_ref = entry->data[0];
+ if (gst_tag_list_get_string (meudata->taglist, GST_TAG_GPS_LATITUDE,
+ &value)) {
+ GString *str = g_string_new (value);
+
+ if (str->len == 10) {
+ str->str[9] = meudata->latitude_ref;
+ gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
+ GST_TAG_GPS_LATITUDE, str->str, NULL);
+ }
+ g_string_free (str, TRUE);
+ }
+
+ }
+ break;
+ case EXIF_TAG_GPS_LONGITUDE_REF:
+ {
+ gchar *value = NULL;
+
+ meudata->longitude_ref = entry->data[0];
+ if (gst_tag_list_get_string (meudata->taglist, GST_TAG_GPS_LONGITUDE,
+ &value)) {
+ GString *str = g_string_new (value);
+
+ if (str->len == 10) {
+ str->str[9] = meudata->longitude_ref;
+ gst_tag_list_add (meudata->taglist, GST_TAG_MERGE_REPLACE,
+ GST_TAG_GPS_LONGITUDE, str->str, NULL);
+ }
+ g_string_free (str, TRUE);
+ }
+ }
+ break;
+ default:
+ ret = FALSE;
+ break;
+ }
+
+ return ret;
+
+}
+
+
+/*
* metadatamux_exif_for_each_tag_in_list:
* @list: GStreamer tag list from which @tag belongs to
* @tag: GStreamer tag to be added to the EXIF chunk
@@ -669,6 +861,21 @@ metadatamux_exif_for_each_tag_in_list (const GstTagList * list,
exif_entry_initialize (entry, exif_tag);
}
+ if (entry->data == NULL) {
+ if (entry->tag == EXIF_TAG_GPS_ALTITUDE) {
+ entry->format = EXIF_FORMAT_RATIONAL;
+ entry->components = 1;
+ entry->size = exif_format_get_size (entry->format) * entry->components;
+ entry->data = g_malloc (entry->size);
+ } else if (entry->tag == EXIF_TAG_GPS_LATITUDE
+ || entry->tag == EXIF_TAG_GPS_LONGITUDE) {
+ entry->format = EXIF_FORMAT_RATIONAL;
+ entry->components = 3;
+ entry->size = exif_format_get_size (entry->format) * entry->components;
+ entry->data = g_malloc (entry->size);
+ }
+ }
+
if (type == GST_TYPE_FRACTION) {
const GValue *gvalue = gst_tag_list_get_value_index (list, tag, 0);
gint numerator = gst_value_get_fraction_numerator (gvalue);
@@ -684,9 +891,35 @@ metadatamux_exif_for_each_tag_in_list (const GstTagList * list,
break;
case EXIF_FORMAT_RATIONAL:
{
- ExifRational r = { numerator, denominator };
+ ExifRational r;
- exif_set_rational (entry->data, byte_order, r);
+ if (entry->tag == EXIF_TAG_GPS_ALTITUDE) {
+
+ ExifEntry *ref_entry = NULL;
+
+ ref_entry = exif_data_get_entry (ed, EXIF_TAG_GPS_ALTITUDE_REF);
+ if (ref_entry) {
+ exif_entry_ref (ref_entry);
+ } else {
+ ref_entry = exif_entry_new ();
+ exif_content_add_entry (ed->ifd[EXIF_IFD_GPS], ref_entry);
+ exif_entry_initialize (ref_entry, EXIF_TAG_GPS_ALTITUDE_REF);
+ }
+ if (ref_entry->data == NULL) {
+ ref_entry->format = EXIF_FORMAT_BYTE;
+ ref_entry->components = 1;
+ ref_entry->size = 1;
+ ref_entry->data = g_malloc (1);
+ }
+ /* if n * d > 0 */
+ if (IS_FRACT_POSITIVE (numerator, denominator)) {
+ ref_entry->data[0] = 0;
+ } else {
+ ref_entry->data[0] = 1;
+ }
+ exif_entry_unref (ref_entry);
+
+ }
if (entry->tag == EXIF_TAG_X_RESOLUTION ||
entry->tag == EXIF_TAG_Y_RESOLUTION) {
ExifEntry *unit_entry = NULL;
@@ -700,11 +933,28 @@ metadatamux_exif_for_each_tag_in_list (const GstTagList * list,
exif_set_short (unit_entry->data, byte_order, 2);
}
}
+ r.numerator = numerator;
+ r.denominator = denominator;
+ if (numerator < 0)
+ r.numerator = -numerator;
+ if (denominator < 0)
+ r.denominator = -denominator;
+ exif_set_rational (entry->data, byte_order, r);
}
break;
default:
break;
}
+ } else if (type == GST_TYPE_BUFFER) {
+ const GValue *val = NULL;
+ GstBuffer *buf;
+
+ val = gst_tag_list_get_value_index (list, tag, 0);
+ buf = gst_value_get_buffer (val);
+ entry->components = GST_BUFFER_SIZE (buf);
+ entry->size = GST_BUFFER_SIZE (buf);
+ entry->data = g_malloc (entry->size);
+ memcpy (entry->data, GST_BUFFER_DATA (buf), entry->size);
} else {
switch (type) {
@@ -713,10 +963,59 @@ metadatamux_exif_for_each_tag_in_list (const GstTagList * list,
gchar *value = NULL;
if (gst_tag_list_get_string (list, tag, &value)) {
- entry->components = strlen (value) + 1;
- entry->size =
- exif_format_get_size (entry->format) * entry->components;
- entry->data = (guint8 *) value;
+
+ if (entry->tag == EXIF_TAG_DATE_TIME_DIGITIZED
+ || entry->tag == EXIF_TAG_DATE_TIME
+ || entry->tag == EXIF_TAG_DATE_TIME_ORIGINAL) {
+ GString *datetime = g_string_new_len (value,
+ 20); /* enough memory to hold "YYYY:MM:DD HH:MM:SS" */
+
+ if (metadatamux_exif_convert_from_datetime (datetime)) {
+ } else {
+ GST_ERROR ("Unexpected date & time format for %s", tag);
+ }
+ g_free (value);
+ value = datetime->str;
+ g_string_free (datetime, FALSE);
+ } else if (entry->tag == EXIF_TAG_GPS_LATITUDE
+ || entry->tag == EXIF_TAG_GPS_LONGITUDE) {
+ char ref;
+
+ if (metadatamux_exif_convert_from_gps (entry->data, value, &ref)) {
+ ExifEntry *ref_entry = NULL;
+ const ExifTag ref_tag = entry->tag == EXIF_TAG_GPS_LATITUDE ?
+ EXIF_TAG_GPS_LATITUDE_REF : EXIF_TAG_GPS_LONGITUDE_REF;
+
+ ref_entry = exif_data_get_entry (ed, ref_tag);
+ if (ref_entry) {
+ exif_entry_ref (ref_entry);
+ } else {
+ ref_entry = exif_entry_new ();
+ exif_content_add_entry (ed->ifd[EXIF_IFD_GPS], ref_entry);
+ exif_entry_initialize (ref_entry, ref_tag);
+ }
+ if (ref_entry->data == NULL) {
+ ref_entry->format = EXIF_FORMAT_ASCII;
+ ref_entry->components = 2;
+ ref_entry->size = 2;
+ ref_entry->data = g_malloc (2);
+ }
+ ref_entry->data[0] = ref;
+ ref_entry->data[1] = 0;
+ exif_entry_unref (ref_entry);
+ }
+ /* has already been add and it is not an Exif ASCII type */
+ g_free (value);
+ value = NULL;
+ }
+ if (value) {
+ entry->components = strlen (value) + 1;
+ entry->size =
+ exif_format_get_size (entry->format) * entry->components;
+ entry->data = (guint8 *) value;
+ value = NULL;
+ }
+
}
}
break;
@@ -767,5 +1066,373 @@ done:
}
+/*
+ * metadataparse_exif_convert_to_datetime:
+ * @dt: string containing date_time in format "YYYY:MM:DD HH:MM:SS"
+ *
+ * This function converts a exif date_and_time string @dt into the format
+ * specified by http://www.w3.org/TR/1998/NOTE-datetime-19980827, in which a
+ * subset of ISO RFC 8601 used by XMP.
+ * @dt->allocated_len must be not less than 21 to hold enough memory
+ * hold "YYYY:MM:DD HH:MM:SS" without additional allocation
+ *
+ * Returns:
+ * <itemizedlist>
+ * <listitem><para>#TRUE if succeded
+ * </para></listitem>
+ * <listitem><para>#FALSE if failed
+ * </para></listitem>
+ * </itemizedlist>
+ */
+
+static gboolean
+metadataparse_exif_convert_to_datetime (GString * dt)
+{
+
+ /* "YYYY:MM:DD HH:MM:SS" */
+ /* 012345678901234567890 */
+
+ if (dt->allocated_len < 20)
+ return FALSE;
+
+ /* Fix me: Ideally would be good to get the time zone from othe Exif tag
+ * for the time being, just use local time as explained in XMP specification
+ * (converting from EXIF to XMP date and time) */
+
+ dt->str[4] = '-';
+ dt->str[7] = '-';
+ dt->str[10] = 'T';
+ dt->str[19] = '\0';
+
+ return TRUE;
+
+}
+
+
+/*
+ * metadatamux_exif_convert_from_datetime:
+ * @dt: string containing date_time in format specified by
+ * http://www.w3.org/TR/1998/NOTE-datetime-19980827
+ *
+ * This function converts a date_and_time string @dt as specified by
+ * http://www.w3.org/TR/1998/NOTE-datetime-19980827, in which a
+ * subset of ISO RFC 8601 used by XMP, into Exif date_time format.
+ * @dt->allocated_len must be not less than 20 to hold enough memory
+ * hold "YYYY:MM:DD HH:MM:SS" without additional allocation
+ *
+ * Returns:
+ * <itemizedlist>
+ * <listitem><para>#TRUE if succeded
+ * </para></listitem>
+ * <listitem><para>#FALSE if failed
+ * </para></listitem>
+ * </itemizedlist>
+ */
+
+static gboolean
+metadatamux_exif_convert_from_datetime (GString * dt)
+{
+ gboolean ret = TRUE;
+ char *p = dt->str;
+
+ if (dt->allocated_len < 20)
+ goto error;
+
+ /* check YYYY */
+
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+
+ if (*p == '\0') {
+ sprintf (p, ":01:01 00:00:00");
+ goto done;
+ } else if (*p == '-') {
+ *p++ = ':';
+ } else
+ goto error;
+
+ /* check MM */
+
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+
+ if (*p == '\0') {
+ sprintf (p, ":01 00:00:00");
+ goto done;
+ } else if (*p == '-') {
+ *p++ = ':';
+ } else
+ goto error;
+
+ /* check DD */
+
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+
+ if (*p == '\0') {
+ sprintf (p, " 00:00:00");
+ goto done;
+ } else if (*p == 'T') {
+ *p++ = ' ';
+ } else
+ goto error;
+
+ /* check hh */
+
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+
+ if (*p++ != ':')
+ goto error;
+
+ /* check mm */
+
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+
+ if (*p == ':') {
+ p++;
+ } else if (*p == 'Z' || *p == '+' || *p == '-') {
+ /* FIXME: in case of '+' or '-', it would be better to also fill another
+ * EXIF tag in order to save, somehow the time zone info */
+ sprintf (p, ":00");
+ goto done;
+ } else
+ goto error;
+
+ /* check ss */
+
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+ if (IS_NUMBER (*p))
+ p++;
+ else
+ goto error;
+
+ *p = '\0';
+
+ /* if here, everything is ok */
+ goto done;
+error:
+
+ ret = FALSE;
+
+done:
+
+ /* FIXME: do we need to check if the date is valid ? */
+
+ if (ret)
+ dt->len = 19;
+ return ret;
+
+}
+
+/*
+ * metadatamux_exif_convert_from_gps:
+ * @data: pointer to an array of 3 ExifRational in which gps will be stored
+ * @lt: a string containing the gps coordinate formated as "DDD,MM,SSk"
+ * or "DDD,MM.mmk" (this is the same as specified in XMP).
+ * @ref: at the end will store the reference ('N', 'S', 'E', 'W')
+ *
+ * This function converts from the format "DDD,MM,SSk" or "DDD,MM.mmk"
+ * (the same as specified in XMP) into Exif coordinates.
+ * D- degrees, M- minutes, S- seconds, k- 'N', 'S', 'E', 'W'
+ * (North, South, East, West)
+ *
+ * Returns:
+ * <itemizedlist>
+ * <listitem><para>%TRUE if converted sucessfull
+ * </para></listitem>
+ * <listitem><para>%FALSE if @lt is bad formated
+ * </para></listitem>
+ * </itemizedlist>
+ */
+
+static gboolean
+metadatamux_exif_convert_from_gps (guint8 * data, const char *lt, char *ref)
+{
+ /* "DDD,MM,SSk" or "DDD,MM.mmk" */
+ /* 0123456789 0123456789 */
+ gboolean ret = TRUE;
+ char *p = (char *) lt;
+ ExifRational *rt = (ExifRational *) data;
+
+ if (strlen (lt) != 10)
+ goto error;
+
+ if (lt[6] == ',' || lt[6] == '.') {
+ if (IS_NUMBER (*p) && IS_NUMBER (*(p + 1)) && IS_NUMBER (*(p + 2))) {
+ rt->numerator = CHAR_TO_INT (*p) * 100;
+ p++;
+ rt->numerator += CHAR_TO_INT (*p) * 10;
+ p++;
+ rt->numerator += CHAR_TO_INT (*p);
+ p++;
+ rt->denominator = 1;
+ } else {
+ goto error;
+ }
+ p++;
+ rt++;
+ if (IS_NUMBER (*p) && IS_NUMBER (*(p + 1))) {
+ rt->numerator = CHAR_TO_INT (*p) * 10;
+ p++;
+ rt->numerator += CHAR_TO_INT (*p);
+ p++;
+ rt->denominator = 1;
+ } else {
+ goto error;
+ }
+ p++;
+ rt++;
+ if (IS_NUMBER (*p) && IS_NUMBER (*(p + 1))) {
+ rt->numerator = CHAR_TO_INT (*p) * 10;
+ p++;
+ rt->numerator += CHAR_TO_INT (*p);
+ p++;
+ rt->denominator = 1;
+ } else {
+ goto error;
+ }
+ } else {
+ goto error;
+ }
+
+ if (lt[9] != 'N' && lt[9] != 'S' && lt[9] != 'E' && lt[9] != 'W')
+ goto error;
+
+ *ref = lt[9];
+
+ goto done;
+error:
+
+ ret = FALSE;
+
+done:
+
+ return ret;
+
+}
+
+/*
+ * metadatamux_exif_convert_from_gps:
+ * @data: pointer to an array of 3 ExifRational from which gps will be read
+ * @lt: at the end this will have the gps coordinate formated as "DDD,MM,SSk"
+ * or "DDD,MM.mmk" (this is the same as specified in XMP).
+ * @exif_tag: EXIF_TAG_GPS_LATITUDE or EXIF_TAG_GPS_LONGITUDE
+ * @meudata: at the end will store the reference ('N', 'S', 'E', 'W')
+ * in @meudata->latitude_ref or meudata->longitude_ref depending on @exif_tag
+ *
+ * This function converts from Exif coordinates to the format "DDD,MM,SSk"
+ * or "DDD,MM.mmk" (the same as specified in XMP).
+ * D- degrees, M- minutes, S- seconds, k- 'N', 'S', 'E', 'W'
+ * (North, South, East, West)
+ * Precondition: @lt->allocated_len must be at least 11.
+ *
+ * Returns:
+ * <itemizedlist>
+ * <listitem><para>%TRUE if converted sucessfull
+ * </para></listitem>
+ * <listitem><para>%FALSE if error
+ * </para></listitem>
+ * </itemizedlist>
+ */
+
+static gboolean
+metadataparse_exif_convert_to_gps (const guint8 * data, GString * lt,
+ const int exif_tag, const MEUserData * meudata)
+{
+ ExifRational *rt = (ExifRational *) data;
+ char *str = lt->str;
+ gboolean ret = TRUE;
+ char ref;
+
+ if (lt->allocated_len < 11)
+ goto error;
+
+ if (exif_tag == EXIF_TAG_GPS_LATITUDE)
+ ref = meudata->latitude_ref;
+ else if (exif_tag == EXIF_TAG_GPS_LONGITUDE)
+ ref = meudata->longitude_ref;
+ else
+ goto error;
+
+ /* DDD - degrees */
+
+ sprintf (str, "%03u,", rt->numerator / rt->denominator);
+ rt++;
+ str += 4;
+
+ /* MM - minutes and SS - seconds */
+
+ if (rt->numerator % rt->denominator) {
+ sprintf (str, "%05.02f", (float) rt->numerator / (float) rt->denominator);
+ str += 5;
+ *str++ = ref;
+ *str = '\0';
+ } else {
+ sprintf (str, "%02u,", rt->numerator / rt->denominator);
+ str += 3;
+ rt++;
+ sprintf (str, "%02u", rt->numerator / rt->denominator);
+ str += 2;
+ *str++ = ref;
+ *str = '\0';
+ }
+
+ /* if here, everything is ok */
+ goto done;
+error:
+
+ ret = FALSE;
+
+done:
+
+ /* FIXME: do we need to check if the date is valid ? */
+
+ if (ret)
+ lt->len = 10;
+ return ret;
+}
#endif /* else (ifndef HAVE_EXIF) */
diff --git a/ext/metadata/metadatatags.c b/ext/metadata/metadatatags.c
index e8b0c1f3..b79830d1 100644
--- a/ext/metadata/metadatatags.c
+++ b/ext/metadata/metadatatags.c
@@ -364,29 +364,98 @@ metadata_tags_exif_register (void)
"The name of the first known tool used to create the resource."
" Or firmware or driver version of device", NULL);
+ /* date and time tags */
+ /* formated as subset of ISO RFC 8601 as described in
+ * http://www.w3.org/TR/1998/NOTE-datetime-19980827
+ * which is:
+ * YYYY
+ * YYYY-MM
+ * YYYY-MM-DD
+ * YYYY-MM-DDThh:mmTZD
+ * YYYY-MM-DDThh:mm:ssTZD
+ * YYYY-MM-DDThh:mm:ss.sTZD
+ * where:
+ * YYYY = four-digit year
+ * MM = two-digit month (01=January)
+ * DD = two-digit day of month (01 through 31)
+ * hh = two digits of hour (00 through 23)
+ * mm = two digits of minute (00 through 59)
+ * ss = two digits of second (00 through 59)
+ * s = one or more digits representing a decimal fraction of a second
+ * TZD = time zone designator (Z or +hh:mm or -hh:mm)
+ */
+
+ gst_tag_register (GST_TAG_DATE_TIME_DIGITIZED, GST_TAG_FLAG_META,
+ G_TYPE_STRING, GST_TAG_DATE_TIME_DIGITIZED,
+ "Date/Time of image digitized", NULL);
+
+ gst_tag_register (GST_TAG_DATE_TIME_MODIFIED, GST_TAG_FLAG_META,
+ G_TYPE_STRING, GST_TAG_DATE_TIME_MODIFIED,
+ "Date/Time of image was last modified", NULL);
+
+ gst_tag_register (GST_TAG_DATE_TIME_ORIGINAL, GST_TAG_FLAG_META,
+ G_TYPE_STRING, GST_TAG_DATE_TIME_ORIGINAL,
+ "Date/Time of original image taken", NULL);
+
/* devices tags */
gst_tag_register (GST_TAG_DEVICE_MAKE, GST_TAG_FLAG_META,
G_TYPE_STRING, GST_TAG_DEVICE_MAKE,
"The manufacturer of the recording equipment", NULL);
+
gst_tag_register (GST_TAG_DEVICE_MODEL, GST_TAG_FLAG_META, G_TYPE_STRING,
GST_TAG_DEVICE_MODEL, "The model name or model number of the equipment",
NULL);
+ /* exif specific tags */
+
+ gst_tag_register (GST_TAG_EXIF_MAKER_NOTE, GST_TAG_FLAG_META,
+ GST_TYPE_BUFFER, GST_TAG_EXIF_MAKER_NOTE, "Camera private data", NULL);
+
/* image tags */
gst_tag_register (GST_TAG_IMAGE_HEIGHT, GST_TAG_FLAG_META,
G_TYPE_UINT, GST_TAG_IMAGE_HEIGHT, "Image height in pixels", NULL);
+
gst_tag_register (GST_TAG_IMAGE_WIDTH, GST_TAG_FLAG_META,
G_TYPE_UINT, GST_TAG_IMAGE_WIDTH, "Image width in pixels", NULL);
gst_tag_register (GST_TAG_IMAGE_XRESOLUTION, GST_TAG_FLAG_META,
GST_TYPE_FRACTION, GST_TAG_IMAGE_XRESOLUTION,
"Horizontal resolution in pixels per inch", NULL);
+
gst_tag_register (GST_TAG_IMAGE_YRESOLUTION, GST_TAG_FLAG_META,
GST_TYPE_FRACTION, GST_TAG_IMAGE_YRESOLUTION,
"Vertical resolution in pixels per inch", NULL);
+ /* GPS tags */
+
+ /* Altitude:
+ * positive values means above the sea level
+ * negative values means under the sea level
+ */
+
+ gst_tag_register (GST_TAG_GPS_ALTITUDE, GST_TAG_FLAG_META,
+ GST_TYPE_FRACTION, GST_TAG_GPS_ALTITUDE, "Altitude", NULL);
+
+ /* Latitude:
+ * "DDD,MM,SSk" or "DDD,MM.mmk" fixed size string where:
+ * D- degrees, M- minutes, S-seconds,
+ * mm- fraction of minutes, k- N (north) or S (south)
+ */
+
+ gst_tag_register (GST_TAG_GPS_LATITUDE, GST_TAG_FLAG_META,
+ G_TYPE_STRING, GST_TAG_GPS_LATITUDE, "Latitude", NULL);
+
+ /* Longitude:
+ * "DDD,MM,SSk" or "DDD,MM.mmk" fixed size string where:
+ * D- degrees, M- minutes, S-seconds,
+ * mm- fraction of minutes, k- N (north) or S (south)
+ */
+
+ gst_tag_register (GST_TAG_GPS_LONGITUDE, GST_TAG_FLAG_META,
+ G_TYPE_STRING, GST_TAG_GPS_LONGITUDE, "Longitude", NULL);
+
}
/*
diff --git a/ext/metadata/metadatatags.h b/ext/metadata/metadatatags.h
index 1e298166..004a17c2 100644
--- a/ext/metadata/metadatatags.h
+++ b/ext/metadata/metadatatags.h
@@ -102,14 +102,33 @@ typedef enum {
#define GST_TAG_CREATOR_TOOL "creator-tool"
+#define GST_TAG_DATE_TIME_DIGITIZED "date-time-digitized"
+#define GST_TAG_DATE_TIME_MODIFIED "date-time-modified"
+#define GST_TAG_DATE_TIME_ORIGINAL "date-time-original"
+
#define GST_TAG_DEVICE_MAKE "device-make"
#define GST_TAG_DEVICE_MODEL "device-model"
+#define GST_TAG_EXIF_MAKER_NOTE "exif-maker-note"
+
#define GST_TAG_IMAGE_HEIGHT "image-height"
#define GST_TAG_IMAGE_WIDTH "image-width"
#define GST_TAG_IMAGE_XRESOLUTION "image-xresolution"
#define GST_TAG_IMAGE_YRESOLUTION "image-yresolution"
+#define GST_TAG_GPS_ALTITUDE "gps-altitude"
+#define GST_TAG_GPS_AREA_INFORMATION ""
+#define GST_TAG_GPS_DIFFERENTIAL ""
+#define GST_TAG_GPS_DOP ""
+#define GST_TAG_GPS_IMAGE_DIRECTION ""
+#define GST_TAG_GPS_LATITUDE "gps-latitude"
+#define GST_TAG_GPS_LONGITUDE "gps-longitude"
+#define GST_TAG_GPS_MEASURE_MODE ""
+#define GST_TAG_GPS_PROCESSING_METHOD ""
+#define GST_TAG_GPS_SATELLITES ""
+#define GST_TAG_GPS_SPEED ""
+#define GST_TAG_GPS_TRACK ""
+
/* *INDENT-ON* */
/*