1 /*
2  gaiaexif.h -- Gaia common EXIF Metadata reading functions
3 
4  version 5.0, 2020 August 1
5 
6  Author: Sandro Furieri a.furieri@lqt.it
7 
8  ------------------------------------------------------------------------------
9 
10  Version: MPL 1.1/GPL 2.0/LGPL 2.1
11 
12  The contents of this file are subject to the Mozilla Public License Version
13  1.1 (the "License"); you may not use this file except in compliance with
14  the License. You may obtain a copy of the License at
15  http://www.mozilla.org/MPL/
16 
17 Software distributed under the License is distributed on an "AS IS" basis,
18 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 for the specific language governing rights and limitations under the
20 License.
21 
22 The Original Code is the SpatiaLite library
23 
24 The Initial Developer of the Original Code is Alessandro Furieri
25 
26 Portions created by the Initial Developer are Copyright (C) 2008-2021
27 the Initial Developer. All Rights Reserved.
28 
29 Contributor(s):
30 
31 Alternatively, the contents of this file may be used under the terms of
32 either the GNU General Public License Version 2 or later (the "GPL"), or
33 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
34 in which case the provisions of the GPL or the LGPL are applicable instead
35 of those above. If you wish to allow use of your version of this file only
36 under the terms of either the GPL or the LGPL, and not to allow others to
37 use your version of this file under the terms of the MPL, indicate your
38 decision by deleting the provisions above and replace them with the notice
39 and other provisions required by the GPL or the LGPL. If you do not delete
40 the provisions above, a recipient may use your version of this file under
41 the terms of any one of the MPL, the GPL or the LGPL.
42 
43 */
44 
45 /**
46  \file gaiaexif.h
47 
48  EXIF/image: supporting functions and constants
49  */
50 
51 #ifndef DOXYGEN_SHOULD_SKIP_THIS
52 #ifdef DLL_EXPORT
53 #define GAIAEXIF_DECLARE __declspec(dllexport)
54 #else
55 #define GAIAEXIF_DECLARE extern
56 #endif
57 #endif
58 
59 #ifndef _GAIAEXIF_H
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61 #define _GAIAEXIF_H
62 #endif
63 
64 #ifdef __cplusplus
65 extern "C"
66 {
67 #endif
68 
69 /* constants used for BLOB value types */
70 /** generic hexadecimal BLOB */
71 #define GAIA_HEX_BLOB		0
72 /** this BLOB does actually contain a GIF image */
73 #define GAIA_GIF_BLOB		1
74 /** this BLOB does actually containt a PNG image */
75 #define GAIA_PNG_BLOB		2
76 /** this BLOB does actually contain a generic JPEG image */
77 #define GAIA_JPEG_BLOB		3
78 /** this BLOB does actually contain a JPEG-EXIF image */
79 #define GAIA_EXIF_BLOB		4
80 /** this BLOB does actually contain a JPEG-EXIF image including GPS data */
81 #define GAIA_EXIF_GPS_BLOB	5
82 /** this BLOB does actually contain a ZIP compressed file */
83 #define GAIA_ZIP_BLOB		6
84 /** this BLOB does actually contain a PDF document */
85 #define GAIA_PDF_BLOB		7
86 /** this BLOB does actually contain a SpatiaLite Geometry (not compressed) */
87 #define GAIA_GEOMETRY_BLOB	8
88 /** this BLOB does actually contain a SpatiaLite Geometry (compressed) */
89 #define GAIA_COMPRESSED_GEOMETRY_BLOB	9
90 /** this BLOB does actually contain a TIFF image */
91 #define GAIA_TIFF_BLOB		10
92 /** this BLOB does actually contain a WebP image */
93 #define GAIA_WEBP_BLOB		11
94 /** this BLOB does actually contain a JP2 (Jpeg2000) image */
95 #define GAIA_JP2_BLOB		12
96 /** this BLOB does actually contain a SpatiaLite XmlBLOB */
97 #define GAIA_XML_BLOB		13
98 /** this BLOB does actually contain a GPKG Geometry */
99 #define GAIA_GPB_BLOB		14
100 /** this BLOB does actually contain a SpatiaLite TinyPoint */
101 #define GAIA_TINYPOINT_BLOB	15
102 
103 /* constants used for EXIF value types */
104 /** unrecognized EXIF value */
105 #define GAIA_EXIF_NONE		0
106 /** EXIF value of the BYTE type */
107 #define GAIA_EXIF_BYTE		1
108 /** EXIF value of the SHORT type */
109 #define GAIA_EXIF_SHORT		2
110 /** EXIF value of the STRING type */
111 #define GAIA_EXIF_STRING	3
112 /** EXIF value of the LONG type */
113 #define GAIA_EXIF_LONG		4
114 /** EXIF value of the RATIONAL type */
115 #define GAIA_EXIF_RATIONAL	5
116 /** EXIF value of the SLONG type */
117 #define GAIA_EXIF_SLONG		9
118 /** EXIF value of the SRATIONAL type */
119 #define GAIA_EXIF_SRATIONAL	10
120 
121 /**
122  Container for an EXIF tag
123  */
124     typedef struct gaiaExifTagStruct
125     {
126 /* an EXIF TAG */
127 	/** GPS data included (0/1) */
128 	char Gps;
129 	/** EXIF tag ID */
130 	unsigned short TagId;
131 	/** EXIF value type */
132 	unsigned short Type;
133 	/** number of values */
134 	unsigned short Count;
135 	/** tag offset [big- little-endian encoded] */
136 	unsigned char TagOffset[4];
137 	/** array of BYTE values */
138 	unsigned char *ByteValue;
139 	/** array of STRING values */
140 	char *StringValue;
141 	/** array of SHORT values */
142 	unsigned short *ShortValues;
143 	/** array of LONG values ] */
144 	unsigned int *LongValues;
145 	/** array of RATIONAL values [numerators] */
146 	unsigned int *LongRationals1;
147 	/** array of RATIONAL values [denominators] */
148 	unsigned int *LongRationals2;
149 	/** array of Signed SHORT values */
150 	short *SignedShortValues;
151 	/** array of Signed LONG values */
152 	int *SignedLongValues;
153 	/** array of Signed RATIONAL values [numerators] */
154 	int *SignedLongRationals1;
155 	/** array of Signed RATIONAL values [denominators] */
156 	int *SignedLongRationals2;
157 	/** array of FLOAT values */
158 	float *FloatValues;
159 	/** array of DOUBLE values */
160 	double *DoubleValues;
161 	/** pointer to next item into the linked list */
162 	struct gaiaExifTagStruct *Next;
163     } gaiaExifTag;
164 /**
165  Typedef for EXIF tag structure.
166 
167  \sa gaiaExifTagStruct
168  */
169     typedef gaiaExifTag *gaiaExifTagPtr;
170 
171 /**
172  Container for a list of EXIF tags
173  */
174     typedef struct gaiaExifTagListStruct
175     {
176 /* an EXIF TAG LIST */
177 	/** pointer to first item into the linked list */
178 	gaiaExifTagPtr First;
179 	/** pointer to the last item into the linked list */
180 	gaiaExifTagPtr Last;
181 	/** number of items */
182 	int NumTags;
183 	/** an array of pointers to items */
184 	gaiaExifTagPtr *TagsArray;
185     } gaiaExifTagList;
186 /**
187  Typedef for EXIF tag structure
188 
189  \sa gaiaExifTagListStruct
190  */
191     typedef gaiaExifTagList *gaiaExifTagListPtr;
192 
193 /* function prototipes */
194 
195 /**
196  Creates a list of EXIF tags by parsing a BLOB of the JPEG-EXIF type
197 
198  \param blob the BLOB to be parsed
199  \param size the BLOB size (in bytes)
200 
201  \return a list of EXIF tags: or NULL if any error is encountered
202 
203  \sa gaiaExifTagsFree
204 
205  \note you must explicitly destroy the list when it's any longer used.
206  */
207     GAIAEXIF_DECLARE gaiaExifTagListPtr gaiaGetExifTags (const unsigned char
208 							 *blob, int size);
209 
210 /**
211  Destroy a list of EXIF tags
212 
213  \param tag_list the list to be destroied
214 
215  \sa gaiaGetExifTags
216 
217  \note the pointer passed to this function must be one returned by a
218  previous call to gaiaGetExifTags
219  */
220     GAIAEXIF_DECLARE void gaiaExifTagsFree (gaiaExifTagListPtr tag_list);
221 
222 /**
223  Return the total number of EXIF tags into the list
224 
225  \param tag_list pointer to an EXIF tag list.
226 
227  \return the EXIF tag count.
228 
229  \sa gaiaGetExifTags, gaiaExifTagsFree
230  */
231     GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list);
232 
233 /**
234  Retrieves an EXIF tag by its relative position into the list
235 
236  \param tag_list pointer to an EXIF tag list.
237  \param pos relative item position [first item is 0]
238 
239  \return a pointer to the corresponding EXIF tag: NULL if not found
240 
241  \sa gaiaGetExifTags, gaiaExifTagsFree, gaiaExifTagsCount
242  */
243     GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByPos (gaiaExifTagListPtr
244 							 tag_list,
245 							 const int pos);
246 
247 /**
248  Return the total number of EXIF tags into the list
249 
250  \param tag_list pointer to an EXIF tag list.
251 
252  \return the EXIF tag count.
253 
254  \sa gaiaGetExifTags, gaiaExifTagsFree
255  */
256     GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list);
257 
258 /**
259  Retrieves an EXIF tag by its Tag ID
260 
261  \param tag_list pointer to an EXIF tag list.
262  \param tag_id the Tag ID to be found
263 
264  \return a pointer to the corresponding EXIF tag: NULL if not found
265 
266  \sa gaiaGetExifTags, gaiaExifTagsFree
267  */
268     GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagById (const
269 							gaiaExifTagListPtr
270 							tag_list,
271 							const unsigned short
272 							tag_id);
273 
274 /**
275  Retrieves an EXIF-GPS tag by its Tag ID
276 
277  \param tag_list pointer to an EXIF tag list.
278  \param tag_id the GPS Tag ID to be found
279 
280  \return a pointer to the corresponding EXIF tag: NULL if not found
281 
282  \sa gaiaGetExifTags, gaiaExifTagsFree
283  */
284     GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifGpsTagById (const
285 							   gaiaExifTagListPtr
286 							   tag_list,
287 							   const unsigned
288 							   short tag_id);
289 
290 /**
291  Retrieves an EXIF tag by its name
292 
293  \param tag_list pointer to an EXIF tag list.
294  \param tag_name the Tag Name to be found
295 
296  \return a pointer to the corresponding EXIF tag: NULL if not found
297 
298  \sa gaiaGetExifTags, gaiaExifTagsFree
299  */
300     GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByName (const
301 							  gaiaExifTagListPtr
302 							  tag_list,
303 							  const char *tag_name);
304 
305 /**
306  Return the Tag ID from an EXIF tag
307 
308  \param tag pointer to an EXIF tag
309 
310  \return the Tag ID
311 
312  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName
313  */
314     GAIAEXIF_DECLARE unsigned short gaiaExifTagGetId (const gaiaExifTagPtr tag);
315 
316 /**
317  Return the Tag Name from an EXIF tag
318 
319  \param tag pointer to an EXIF tag
320  \param tag_name receiving buffer: the Tag Name will be copied here
321  \param len length of the receiving buffer
322 
323  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName
324  */
325     GAIAEXIF_DECLARE void gaiaExifTagGetName (const gaiaExifTagPtr tag,
326 					      char *tag_name, int len);
327 
328 /**
329  Checks if an EXIF tag actually is an EXIF-GPS tag
330 
331  \param tag pointer to an EXIF tag
332 
333  \return 0 if false: any other value if true
334 
335  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName
336  */
337     GAIAEXIF_DECLARE int gaiaIsExifGpsTag (const gaiaExifTagPtr tag);
338 
339 /**
340  Return the value type for an EXIF tag
341 
342  \param tag pointer to an EXIF tag
343 
344  \return the value type: one of GAIA_EXIF_NONE, GAIA_EXIF_BYTE,
345  GAIA_EXIF_SHORT, GAIA_EXIF_STRING, GAIA_EXIF_LONG, GAIA_EXIF_RATIONAL,
346  GAIA_EXIF_SLONG, GAIA_EXIF_SRATIONAL
347 
348  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName
349  */
350     GAIAEXIF_DECLARE unsigned short gaiaExifTagGetValueType (const
351 							     gaiaExifTagPtr
352 							     tag);
353 
354 /**
355  Return the total count of values from an EXIF tag
356 
357  \param tag pointer to an EXIF tag
358 
359  \return the number of available values
360 
361  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName
362  */
363     GAIAEXIF_DECLARE unsigned short gaiaExifTagGetNumValues (const
364 							     gaiaExifTagPtr
365 							     tag);
366 
367 /**
368  Return a BYTE value from an EXIF tag
369 
370  \param tag pointer to an EXIF tag.
371  \param ind value index [first value has index 0].
372  \param ok on completion will contain 0 on failure: any other value on success.
373 
374  \return the BYTE value
375 
376  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
377  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
378  */
379     GAIAEXIF_DECLARE unsigned char gaiaExifTagGetByteValue (const
380 							    gaiaExifTagPtr
381 							    tag,
382 							    const int ind,
383 							    int *ok);
384 
385 /**
386  Return a STRING value from an EXIF tag
387 
388  \param tag pointer to an EXIF tag.
389  \param str receiving buffer: the STRING value will be copied here.
390  \param len length of the receiving buffer
391  \param ok on completion will contain 0 on failure: any other value on success.
392 
393  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
394  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
395  */
396     GAIAEXIF_DECLARE void gaiaExifTagGetStringValue (const gaiaExifTagPtr tag,
397 						     char *str, int len,
398 						     int *ok);
399 
400 /**
401  Return a SHORT value from an EXIF tag
402 
403  \param tag pointer to an EXIF tag.
404  \param ind value index [first value has index 0].
405  \param ok on completion will contain 0 on failure: any other value on success.
406 
407  \return the SHORT value
408 
409  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
410  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
411  */
412     GAIAEXIF_DECLARE unsigned short gaiaExifTagGetShortValue (const
413 							      gaiaExifTagPtr
414 							      tag,
415 							      const int ind,
416 							      int *ok);
417 
418 /**
419  Return a LONG value from an EXIF tag
420 
421  \param tag pointer to an EXIF tag.
422  \param ind value index [first value has index 0].
423  \param ok on completion will contain 0 on failure: any other value on success.
424 
425  \return the LONG value
426 
427  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
428  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
429  */
430     GAIAEXIF_DECLARE unsigned int gaiaExifTagGetLongValue (const
431 							   gaiaExifTagPtr tag,
432 							   const int ind,
433 							   int *ok);
434 
435 /**
436  Return a RATIONAL [numerator] value from an EXIF tag
437 
438  \param tag pointer to an EXIF tag.
439  \param ind value index [first value has index 0].
440  \param ok on completion will contain 0 on failure: any other value on success.
441 
442  \return the RATIONAL [numerator] value
443 
444  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
445  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
446  */
447     GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational1Value (const
448 								gaiaExifTagPtr
449 								tag,
450 								const int ind,
451 								int *ok);
452 
453 /**
454  Return a RATIONAL [denominator] value from an EXIF tag
455 
456  \param tag pointer to an EXIF tag.
457  \param ind value index [first value has index 0].
458  \param ok on completion will contain 0 on failure: any other value on success.
459 
460  \return the RATIONAL [denominator] value
461 
462  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
463  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
464  */
465     GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational2Value (const
466 								gaiaExifTagPtr
467 								tag,
468 								const int ind,
469 								int *ok);
470 
471 /**
472  Return a RATIONAL value from an EXIF tag
473 
474  \param tag pointer to an EXIF tag.
475  \param ind value index [first value has index 0].
476  \param ok on completion will contain 0 on failure: any other value on success.
477 
478  \return the RATIONAL value
479 
480  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
481  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
482  */
483     GAIAEXIF_DECLARE double gaiaExifTagGetRationalValue (const gaiaExifTagPtr
484 							 tag, const int ind,
485 							 int *ok);
486 
487 /**
488  Return a Signed SHORT value from an EXIF tag
489 
490  \param tag pointer to an EXIF tag.
491  \param ind value index [first value has index 0].
492  \param ok on completion will contain 0 on failure: any other value on success.
493 
494  \return the Signed SHORT value
495 
496  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
497  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
498  */
499     GAIAEXIF_DECLARE short gaiaExifTagGetSignedShortValue (const
500 							   gaiaExifTagPtr tag,
501 							   const int ind,
502 							   int *ok);
503 
504 /**
505  Return a Signed LONG value from an EXIF tag
506 
507  \param tag pointer to an EXIF tag.
508  \param ind value index [first value has index 0].
509  \param ok on completion will contain 0 on failure: any other value on success.
510 
511  \return the Signed LONG value
512 
513  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
514  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
515  */
516     GAIAEXIF_DECLARE int gaiaExifTagGetSignedLongValue (const gaiaExifTagPtr
517 							tag, const int ind,
518 							int *ok);
519 
520 /**
521  Return a SRATIONAL [numerator] value from an EXIF tag
522 
523  \param tag pointer to an EXIF tag.
524  \param ind value index [first value has index 0].
525  \param ok on completion will contain 0 on failure: any other value on success.
526 
527  \return the SRATIONAL [numerator] value
528 
529  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
530  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
531  */
532     GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational1Value (const
533 							     gaiaExifTagPtr
534 							     tag,
535 							     const int ind,
536 							     int *ok);
537 
538 /**
539  Return a SRATIONAL [denominator] value from an EXIF tag
540 
541  \param tag pointer to an EXIF tag.
542  \param ind value index [first value has index 0].
543  \param ok on completion will contain 0 on failure: any other value on success.
544 
545  \return the SRATIONAL [denominator] value
546 
547  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
548  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
549  */
550     GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational2Value (const
551 							     gaiaExifTagPtr
552 							     tag,
553 							     const int ind,
554 							     int *ok);
555 
556 /**
557  Return a Signed RATIONAL value from an EXIF tag
558 
559  \param tag pointer to an EXIF tag.
560  \param ind value index [first value has index 0].
561  \param ok on completion will contain 0 on failure: any other value on success.
562 
563  \return the Signed RATIONAL value
564 
565  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
566  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
567  */
568     GAIAEXIF_DECLARE double gaiaExifTagGetSignedRationalValue (const
569 							       gaiaExifTagPtr
570 							       tag,
571 							       const int ind,
572 							       int *ok);
573 
574 /**
575  Return a FLOAT value from an EXIF tag
576 
577  \param tag pointer to an EXIF tag.
578  \param ind value index [first value has index 0].
579  \param ok on completion will contain 0 on failure: any other value on success.
580 
581  \return the FLOAT value
582 
583  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
584  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
585  */
586     GAIAEXIF_DECLARE float gaiaExifTagGetFloatValue (const gaiaExifTagPtr tag,
587 						     const int ind, int *ok);
588 
589 /**
590  Return a DOUBLE value from an EXIF tag
591 
592  \param tag pointer to an EXIF tag.
593  \param ind value index [first value has index 0].
594  \param ok on completion will contain 0 on failure: any other value on success.
595 
596  \return the DOUBLE value
597 
598  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
599  gaiaExifTagGetValueType, gaiaExifTagGetNumValues
600  */
601     GAIAEXIF_DECLARE double gaiaExifTagGetDoubleValue (const gaiaExifTagPtr
602 						       tag, const int ind,
603 						       int *ok);
604 
605 /**
606  Return a human readable description from an EXIF tag
607 
608  \param tag pointer to an EXIF tag.
609  \param str receiving buffer: the STRING value will be copied here.
610  \param len length of the receiving buffer
611  \param ok on completion will contain 0 on failure: any other value on success.
612 
613  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName
614  */
615     GAIAEXIF_DECLARE void gaiaExifTagGetHumanReadable (const gaiaExifTagPtr
616 						       tag, char *str,
617 						       int len, int *ok);
618 
619 /**
620  Attempts to guess the actual content-type of some BLOB
621 
622  \param blob the BLOB to be parsed
623  \param size length of the BLOB (in bytes)
624 
625  \return the BLOB type: one of GAIA_HEX_BLOB, GAIA_GIF_BLOB, GAIA_PNG_BLOB,
626  GAIA_JPEG_BLOB, GAIA_EXIF_BLOB, GAIA_EXIF_GPS_BLOB, GAIA_ZIP_BLOB,
627  GAIA_PDF_BLOB, GAIA_GEOMETRY_BLOB, GAIA_TIFF_BLOB, GAIA_WEBP_BLOB,
628  GAIA_JP2_BLOB, GAIA_XML_BLOB, GAIA_GPB_BLOB
629  */
630     GAIAEXIF_DECLARE int gaiaGuessBlobType (const unsigned char *blob,
631 					    int size);
632 /**
633  Return longitude and latitude from an EXIF-GPS tag
634 
635  \param blob the BLOB to be parsed
636  \param size length of the BLOB (in bytes)
637  \param longitude on success will contain the longitude coordinate
638  \param latitude on success will contain the latitude coordinate
639 
640  \return 0 on failure: any other value on success
641 
642  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
643  gaiaIsExifGpsTag
644  */
645     GAIAEXIF_DECLARE int gaiaGetGpsCoords (const unsigned char *blob,
646 					   int size, double *longitude,
647 					   double *latitude);
648 /**
649  Return a text string representing DMS coordinates from an EXIF-GPS tag
650 
651  \param blob the BLOB to be parsed
652  \param size length of the BLOB (in bytes)
653  \param latlong receiving buffer: the text string will be copied here.
654  \param ll_size length of the receiving buffer
655 
656  \return 0 on failure: any other value on success
657 
658  \sa gaiaGetExifTagById, gaiaGetExifGpsTagById, gaiaGetExifTagByName,
659  gaiaIsExifGpsTag
660  */
661     GAIAEXIF_DECLARE int gaiaGetGpsLatLong (const unsigned char *blob,
662 					    int size, char *latlong,
663 					    int ll_size);
664 
665 #ifdef __cplusplus
666 }
667 #endif
668 
669 #endif				/* _GAIAEXIF_H */
670