|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 //#include <e32base.h> |
|
17 #include <iclexif.h> |
|
18 #include "ExifTagDescriptions.h" |
|
19 |
|
20 #include "ExifUtility.h" |
|
21 |
|
22 /** |
|
23 Constructor |
|
24 |
|
25 Instantiates the exif reader utility. |
|
26 Note: no method on this utility should be used after the metadate has been destroyed |
|
27 |
|
28 @param aExifMetadata |
|
29 the metadata class on which to read the tags |
|
30 */ |
|
31 EXPORT_C TExifReaderUtility::TExifReaderUtility(MExifMetadataReader* aExifMetadata) |
|
32 : iExifRead(aExifMetadata) |
|
33 { |
|
34 } |
|
35 |
|
36 |
|
37 // Getters |
|
38 /** |
|
39 Gets the make tag value of the metadata. |
|
40 |
|
41 @param aParam |
|
42 on return, the make value |
|
43 |
|
44 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
45 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
46 |
|
47 @return error code |
|
48 KErrArgument if the requested data type does not match with the tag. |
|
49 KErrNotSupported if called on an encoding module. |
|
50 KErrNotFound if the tag cannot be found. |
|
51 */ |
|
52 EXPORT_C TInt TExifReaderUtility::GetMake(HBufC8*& aParam) const |
|
53 { |
|
54 if(iExifRead==NULL) |
|
55 { |
|
56 return KErrOverflow; |
|
57 } |
|
58 TInt tag = KTag010F[ETagValue]; |
|
59 TInt ifd = KExifIfdZero; |
|
60 return iExifRead->GetParam8(tag, ifd, aParam); |
|
61 } |
|
62 |
|
63 /** |
|
64 Gets the model tag value of the metadata. |
|
65 |
|
66 @param aParam |
|
67 on return, the model value |
|
68 |
|
69 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
70 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
71 |
|
72 @return error code |
|
73 KErrArgument if the requested data type does not match with the tag. |
|
74 KErrNotSupported if called on an encoding module. |
|
75 KErrNotFound if the tag cannot be found. |
|
76 */ |
|
77 EXPORT_C TInt TExifReaderUtility::GetModel(HBufC8*& aParam) const |
|
78 { |
|
79 if(iExifRead==NULL) |
|
80 { |
|
81 return KErrOverflow; |
|
82 } |
|
83 TInt tag = KTag0110[ETagValue]; |
|
84 TInt ifd = KExifIfdZero; |
|
85 return iExifRead->GetParam8(tag, ifd, aParam); |
|
86 } |
|
87 |
|
88 /** |
|
89 Gets the dateTime tag value of the metadata. |
|
90 |
|
91 @param aParam |
|
92 on return, the dateTime value |
|
93 |
|
94 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
95 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
96 |
|
97 @return error code |
|
98 KErrArgument if the requested data type does not match with the tag. |
|
99 KErrNotSupported if called on an encoding module. |
|
100 KErrNotFound if the tag cannot be found. |
|
101 */ |
|
102 EXPORT_C TInt TExifReaderUtility::GetDateTime(HBufC8*& aParam) const |
|
103 { |
|
104 if(iExifRead==NULL) |
|
105 { |
|
106 return KErrOverflow; |
|
107 } |
|
108 TInt tag = KTag0132[ETagValue]; |
|
109 TInt ifd = KExifIfdZero; |
|
110 return iExifRead->GetParam8(tag, ifd, aParam); |
|
111 } |
|
112 |
|
113 /** |
|
114 Gets the dateTimeOriginal tag value of the metadata. |
|
115 |
|
116 @param aParam |
|
117 on return, the dateTimeOriginal value |
|
118 |
|
119 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
120 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
121 |
|
122 @return error code |
|
123 KErrArgument if the requested data type does not match with the tag. |
|
124 KErrNotSupported if called on an encoding module. |
|
125 KErrNotFound if the tag cannot be found. |
|
126 */ |
|
127 EXPORT_C TInt TExifReaderUtility::GetDateTimeOriginal(HBufC8*& aParam) const |
|
128 { |
|
129 if(iExifRead==NULL) |
|
130 { |
|
131 return KErrOverflow; |
|
132 } |
|
133 TInt tag = KTag9003[ETagValue]; |
|
134 TInt ifd = KExifIfdZero; |
|
135 return iExifRead->GetParam8(tag, ifd, aParam); |
|
136 } |
|
137 |
|
138 /** |
|
139 Gets the dateTimeDigitized tag value of the metadata. |
|
140 |
|
141 @param aParam |
|
142 on return, the dateTimeDigitized value |
|
143 |
|
144 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
145 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
146 |
|
147 @return error code |
|
148 KErrArgument if the requested data type does not match with the tag. |
|
149 KErrNotSupported if called on an encoding module. |
|
150 KErrNotFound if the tag cannot be found. |
|
151 */ |
|
152 EXPORT_C TInt TExifReaderUtility::GetDateTimeDigitized(HBufC8*& aParam) const |
|
153 { |
|
154 if(iExifRead==NULL) |
|
155 { |
|
156 return KErrOverflow; |
|
157 } |
|
158 TInt tag = KTag9004[ETagValue]; |
|
159 TInt ifd = KExifIfdZero; |
|
160 return iExifRead->GetParam8(tag, ifd, aParam); |
|
161 } |
|
162 |
|
163 /** |
|
164 Gets the interoperabilityIndex tag value of the metadata. |
|
165 |
|
166 @param aParam |
|
167 on return, the interoperabilityIndex value |
|
168 |
|
169 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
170 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
171 |
|
172 @return error code |
|
173 KErrArgument if the requested data type does not match with the tag. |
|
174 KErrNotSupported if called on an encoding module. |
|
175 KErrNotFound if the tag cannot be found. |
|
176 */ |
|
177 EXPORT_C TInt TExifReaderUtility::GetInteroperabilityIndex(HBufC8*& aParam) const |
|
178 { |
|
179 if(iExifRead==NULL) |
|
180 { |
|
181 return KErrOverflow; |
|
182 } |
|
183 TInt tag = KTag0001[ETagValue]; |
|
184 TInt ifd = KExifIfdZero; |
|
185 return iExifRead->GetParam8(tag, ifd, aParam); |
|
186 } |
|
187 |
|
188 /** |
|
189 Gets the interoperabilityVersion tag value of the metadata. |
|
190 |
|
191 @param aParam |
|
192 on return, the interoperabilityVersion value |
|
193 |
|
194 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
195 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
196 |
|
197 @return error code |
|
198 KErrArgument if the requested data type does not match with the tag. |
|
199 KErrNotSupported if called on an encoding module. |
|
200 KErrNotFound if the tag cannot be found. |
|
201 */ |
|
202 EXPORT_C TInt TExifReaderUtility::GetInteroperabilityVersion(HBufC8*& aParam) const |
|
203 { |
|
204 if(iExifRead==NULL) |
|
205 { |
|
206 return KErrOverflow; |
|
207 } |
|
208 TInt tag = KTag0002[ETagValue]; |
|
209 TInt ifd = KExifIfdZero; |
|
210 return iExifRead->GetParam8(tag, ifd, aParam); |
|
211 } |
|
212 |
|
213 /** |
|
214 Gets the exifVersion tag value of the metadata. |
|
215 |
|
216 @param aParam |
|
217 on return, the exifVersion value |
|
218 |
|
219 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
220 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
221 |
|
222 @return error code |
|
223 KErrArgument if the requested data type does not match with the tag. |
|
224 KErrNotSupported if called on an encoding module. |
|
225 KErrNotFound if the tag cannot be found. |
|
226 */ |
|
227 EXPORT_C TInt TExifReaderUtility::GetExifVersion(HBufC8*& aParam) const |
|
228 { |
|
229 if(iExifRead==NULL) |
|
230 { |
|
231 return KErrOverflow; |
|
232 } |
|
233 TInt tag = KTag9000[ETagValue]; |
|
234 TInt ifd = KExifIfdZero; |
|
235 return iExifRead->GetParam8(tag, ifd, aParam); |
|
236 } |
|
237 |
|
238 /** |
|
239 Gets the componentsConfiguration tag value of the metadata. |
|
240 |
|
241 @param aParam |
|
242 on return, the ComponentConfiguration value |
|
243 |
|
244 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
245 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
246 |
|
247 @return error code |
|
248 KErrArgument if the requested data type does not match with the tag. |
|
249 KErrNotSupported if called on an encoding module. |
|
250 KErrNotFound if the tag cannot be found. |
|
251 */ |
|
252 EXPORT_C TInt TExifReaderUtility::GetComponentsConfiguration(HBufC8*& aParam) const |
|
253 { |
|
254 if(iExifRead==NULL) |
|
255 { |
|
256 return KErrOverflow; |
|
257 } |
|
258 TInt tag = KTag9101[ETagValue]; |
|
259 TInt ifd = KExifIfdZero; |
|
260 return iExifRead->GetParam8(tag, ifd, aParam); |
|
261 } |
|
262 |
|
263 /** |
|
264 Gets the flashpixVersion tag value of the metadata. |
|
265 |
|
266 @param aParam |
|
267 on return, the flashpixVersion value |
|
268 |
|
269 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
270 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
271 |
|
272 @return error code |
|
273 KErrArgument if the requested data type does not match with the tag. |
|
274 KErrNotSupported if called on an encoding module. |
|
275 KErrNotFound if the tag cannot be found. |
|
276 */ |
|
277 EXPORT_C TInt TExifReaderUtility::GetFlashPixVersion(HBufC8*& aParam) const |
|
278 { |
|
279 if(iExifRead==NULL) |
|
280 { |
|
281 return KErrOverflow; |
|
282 } |
|
283 TInt tag = KTagA000[ETagValue]; |
|
284 TInt ifd = KExifIfdZero; |
|
285 return iExifRead->GetParam8(tag, ifd, aParam); |
|
286 } |
|
287 |
|
288 /** |
|
289 Gets the main image xResolution tag value of the metadata. |
|
290 |
|
291 @param aNumerator |
|
292 on return, the main image xResolution numerator value |
|
293 |
|
294 @param aDenominator |
|
295 on return, the main image xResolution denominator value |
|
296 |
|
297 @return error code |
|
298 KErrArgument if the requested data type does not match with the tag. |
|
299 KErrNotSupported if called on an encoding module. |
|
300 KErrNotFound if the tag cannot be found. |
|
301 */ |
|
302 EXPORT_C TInt TExifReaderUtility::GetXResolution(TInt& aNumerator, TInt& aDenominator) const |
|
303 { |
|
304 if(iExifRead==NULL) |
|
305 { |
|
306 return KErrOverflow; |
|
307 } |
|
308 TInt tag = KTag011A[ETagValue]; |
|
309 TInt ifd = KExifIfdZero; |
|
310 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
311 } |
|
312 |
|
313 /** |
|
314 Gets the main image yResolution tag value of the metadata. |
|
315 |
|
316 @param aNumerator |
|
317 on return, the main image yResolution numerator value |
|
318 |
|
319 @param aDenominator |
|
320 on return, the main image yResolution denominator value |
|
321 |
|
322 @return error code |
|
323 KErrArgument if the requested data type does not match with the tag. |
|
324 KErrNotSupported if called on an encoding module. |
|
325 KErrNotFound if the tag cannot be found. |
|
326 */ |
|
327 EXPORT_C TInt TExifReaderUtility::GetYResolution(TInt& aNumerator, TInt& aDenominator) const |
|
328 { |
|
329 if(iExifRead==NULL) |
|
330 { |
|
331 return KErrOverflow; |
|
332 } |
|
333 TInt tag = KTag011B[ETagValue]; |
|
334 TInt ifd = KExifIfdZero; |
|
335 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
336 } |
|
337 |
|
338 /** |
|
339 Gets the thumbnail xResolution tag value of the metadata. |
|
340 |
|
341 @param aNumerator |
|
342 on return, the main thumbnail xResolution numerator value |
|
343 |
|
344 @param aDenominator |
|
345 on return, the main thumbnail xResolution denominator value |
|
346 |
|
347 @return error code |
|
348 KErrArgument if the requested data type does not match with the tag. |
|
349 KErrNotSupported if called on an encoding module. |
|
350 KErrNotFound if the tag cannot be found. |
|
351 */ |
|
352 EXPORT_C TInt TExifReaderUtility::GetThumbXResolution(TInt& aNumerator, TInt& aDenominator) const |
|
353 { |
|
354 if(iExifRead==NULL) |
|
355 { |
|
356 return KErrOverflow; |
|
357 } |
|
358 TInt tag = KThumbTag011A[ETagValue]; |
|
359 TInt ifd = KExifIfdOne; |
|
360 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
361 } |
|
362 |
|
363 /** |
|
364 Gets the thumbnail yResolution tag value of the metadata. |
|
365 |
|
366 @param aNumerator |
|
367 on return, the main thumbnail yResolution numerator value |
|
368 |
|
369 @param aDenominator |
|
370 on return, the main thumbnail yResolution denominator value |
|
371 |
|
372 @return error code |
|
373 KErrArgument if the requested data type does not match with the tag. |
|
374 KErrNotSupported if called on an encoding module. |
|
375 KErrNotFound if the tag cannot be found. |
|
376 */ |
|
377 EXPORT_C TInt TExifReaderUtility::GetThumbYResolution(TInt& aNumerator, TInt& aDenominator) const |
|
378 { |
|
379 if(iExifRead==NULL) |
|
380 { |
|
381 return KErrOverflow; |
|
382 } |
|
383 TInt tag = KThumbTag011B[ETagValue]; |
|
384 TInt ifd = KExifIfdOne; |
|
385 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
386 } |
|
387 |
|
388 /** |
|
389 Gets the main image resolutionUnit tag value of the metadata. |
|
390 |
|
391 @param aParam |
|
392 on return, the main image resolutionUnit value |
|
393 |
|
394 @return error code |
|
395 KErrArgument if the requested data type does not match with the tag. |
|
396 KErrNotSupported if called on an encoding module. |
|
397 KErrNotFound if the tag cannot be found. |
|
398 */ |
|
399 EXPORT_C TInt TExifReaderUtility::GetResolutionUnit(TUint16& aParam) const |
|
400 { |
|
401 if(iExifRead==NULL) |
|
402 { |
|
403 return KErrOverflow; |
|
404 } |
|
405 TInt tag = KTag0128[ETagValue]; |
|
406 TInt ifd = KExifIfdZero; |
|
407 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
408 } |
|
409 |
|
410 /** |
|
411 Gets the yCbCrPositioning tag value of the metadata. |
|
412 |
|
413 @param aParam |
|
414 on return, the yCbCrPositioning value |
|
415 |
|
416 @return error code |
|
417 KErrArgument if the requested data type does not match with the tag. |
|
418 KErrNotSupported if called on an encoding module. |
|
419 KErrNotFound if the tag cannot be found. |
|
420 */ |
|
421 EXPORT_C TInt TExifReaderUtility::GetYCbCrPositioning(TUint16& aParam) const |
|
422 { |
|
423 if(iExifRead==NULL) |
|
424 { |
|
425 return KErrOverflow; |
|
426 } |
|
427 TInt tag = KTag0213[ETagValue]; |
|
428 TInt ifd = KExifIfdZero; |
|
429 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
430 } |
|
431 |
|
432 /** |
|
433 Gets the main image orientation tag value of the metadata. |
|
434 |
|
435 @param aParam |
|
436 on return, the main image orientation value |
|
437 |
|
438 @return error code |
|
439 KErrArgument if the requested data type does not match with the tag. |
|
440 KErrNotSupported if called on an encoding module. |
|
441 KErrNotFound if the tag cannot be found. |
|
442 */EXPORT_C TInt TExifReaderUtility::GetOrientation(TUint16& aParam) const |
|
443 { |
|
444 if(iExifRead==NULL) |
|
445 { |
|
446 return KErrOverflow; |
|
447 } |
|
448 TInt tag = KTag0112[ETagValue]; |
|
449 TInt ifd = KExifIfdZero; |
|
450 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
451 } |
|
452 |
|
453 /** |
|
454 Gets the colorSpace tag value of the metadata. |
|
455 |
|
456 @param aParam |
|
457 on return, the colorSpace value |
|
458 |
|
459 @return error code |
|
460 KErrArgument if the requested data type does not match with the tag. |
|
461 KErrNotSupported if called on an encoding module. |
|
462 KErrNotFound if the tag cannot be found. |
|
463 */ |
|
464 EXPORT_C TInt TExifReaderUtility::GetColorSpace(TUint16& aParam) const |
|
465 { |
|
466 if(iExifRead==NULL) |
|
467 { |
|
468 return KErrOverflow; |
|
469 } |
|
470 TInt tag = KTagA001[ETagValue]; |
|
471 TInt ifd = KExifIfdZero; |
|
472 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
473 } |
|
474 |
|
475 /** |
|
476 Gets the pixelXDimension tag value of the metadata. |
|
477 |
|
478 @param aParam |
|
479 on return, the pixelXDimension value |
|
480 |
|
481 @return error code |
|
482 KErrArgument if the requested data type does not match with the tag. |
|
483 KErrNotSupported if called on an encoding module. |
|
484 KErrNotFound if the tag cannot be found. |
|
485 */ |
|
486 EXPORT_C TInt TExifReaderUtility::GetPixelXDimension(TInt& aParam) const |
|
487 { |
|
488 if(iExifRead==NULL) |
|
489 { |
|
490 return KErrOverflow; |
|
491 } |
|
492 TInt tag = KTagA002[ETagValue]; |
|
493 TInt ifd = KExifIfdZero; |
|
494 |
|
495 //This tag can be SHORT or LONG so first try to read as integer if |
|
496 //that does not work then try as SHORT |
|
497 TInt err = iExifRead->GetIntegerParam(tag, ifd, aParam); |
|
498 |
|
499 if (err == KErrArgument) |
|
500 { |
|
501 //then the tag could be short |
|
502 TUint16 paramShort = 0; |
|
503 err = iExifRead->GetShortParam(tag, ifd, paramShort); |
|
504 if (err == KErrNone) |
|
505 { |
|
506 //tag was SHORT so set aParam |
|
507 aParam = static_cast<TInt>(paramShort); |
|
508 } |
|
509 else |
|
510 { |
|
511 err = KErrArgument; //just to ensure behaviour is unaltered from 9.x |
|
512 } |
|
513 } |
|
514 return err; |
|
515 } |
|
516 |
|
517 /** |
|
518 Gets the pixelYDimension tag value of the metadata. |
|
519 |
|
520 @param aParam |
|
521 on return, the pixelYDimension value |
|
522 |
|
523 @return error code |
|
524 KErrArgument if the requested data type does not match with the tag. |
|
525 KErrNotSupported if called on an encoding module. |
|
526 KErrNotFound if the tag cannot be found. |
|
527 */ |
|
528 EXPORT_C TInt TExifReaderUtility::GetPixelYDimension(TInt& aParam) const |
|
529 { |
|
530 if(iExifRead==NULL) |
|
531 { |
|
532 return KErrOverflow; |
|
533 } |
|
534 TInt tag = KTagA003[ETagValue]; |
|
535 TInt ifd = KExifIfdZero; |
|
536 |
|
537 //This tag can be SHORT or LONG so first try to read as integer if |
|
538 //that does not work then try as SHORT |
|
539 TInt err = iExifRead->GetIntegerParam(tag, ifd, aParam); |
|
540 |
|
541 if (err == KErrArgument) |
|
542 { |
|
543 //then the tag could be short |
|
544 TUint16 paramShort = 0; |
|
545 err = iExifRead->GetShortParam(tag, ifd, paramShort); |
|
546 if (err == KErrNone) |
|
547 { |
|
548 //tag was SHORT so set aParam |
|
549 aParam = static_cast<TInt>(paramShort); |
|
550 } |
|
551 else |
|
552 { |
|
553 err = KErrArgument; //just to ensure behaviour is unaltered from 9.x |
|
554 } |
|
555 } |
|
556 return err; |
|
557 } |
|
558 |
|
559 /** |
|
560 Gets the thumbnail compression tag value of the metadata. |
|
561 |
|
562 @param aParam |
|
563 on return, the thumbnail compression value |
|
564 |
|
565 @return error code |
|
566 KErrArgument if the requested data type does not match with the tag. |
|
567 KErrNotSupported if called on an encoding module. |
|
568 KErrNotFound if the tag cannot be found. |
|
569 */ |
|
570 EXPORT_C TInt TExifReaderUtility::GetThumbCompression(TUint16& aParam) const |
|
571 { |
|
572 if(iExifRead==NULL) |
|
573 { |
|
574 return KErrOverflow; |
|
575 } |
|
576 TInt tag = KThumbTag0103[ETagValue]; |
|
577 TInt ifd = KExifIfdOne; |
|
578 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
579 } |
|
580 |
|
581 /** |
|
582 Gets the thumbnail resolutionUnit tag value of the metadata. |
|
583 |
|
584 @param aParam |
|
585 on return, the thumbnail resolutionUnit value |
|
586 |
|
587 @return error code |
|
588 KErrArgument if the requested data type does not match with the tag. |
|
589 KErrNotSupported if called on an encoding module. |
|
590 KErrNotFound if the tag cannot be found. |
|
591 */ |
|
592 EXPORT_C TInt TExifReaderUtility::GetThumbResolutionUnit(TUint16& aParam) const |
|
593 { |
|
594 if(iExifRead==NULL) |
|
595 { |
|
596 return KErrOverflow; |
|
597 } |
|
598 TInt tag = KThumbTag0128[ETagValue]; |
|
599 TInt ifd = KExifIfdOne; |
|
600 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
601 } |
|
602 |
|
603 /** |
|
604 Gets the thumbnail orientation tag value of the metadata. |
|
605 |
|
606 @param aParam |
|
607 on return, the thumbnail orientation value |
|
608 |
|
609 @return error code |
|
610 KErrArgument if the requested data type does not match with the tag. |
|
611 KErrNotSupported if called on an encoding module. |
|
612 KErrNotFound if the tag cannot be found. |
|
613 */ |
|
614 EXPORT_C TInt TExifReaderUtility::GetThumbOrientation(TUint16& aParam) const |
|
615 { |
|
616 if(iExifRead==NULL) |
|
617 { |
|
618 return KErrOverflow; |
|
619 } |
|
620 TInt tag = KThumbTag0112[ETagValue]; |
|
621 TInt ifd = KExifIfdOne; |
|
622 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
623 } |
|
624 |
|
625 /** |
|
626 Gets the image description tag value of the metadata. |
|
627 |
|
628 @param aParam |
|
629 on return, the image description value. |
|
630 |
|
631 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
632 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
633 |
|
634 @return error code |
|
635 KErrArgument if the requested data type does not match with the tag. |
|
636 KErrNotSupported if called on an encoding module. |
|
637 KErrNotFound if the tag cannot be found. |
|
638 KErrOverflow if there is an internal error with the Exif metadata. |
|
639 */ |
|
640 EXPORT_C TInt TExifReaderUtility::GetImageDescription(HBufC8*& aParam) const |
|
641 { |
|
642 if(iExifRead==NULL) |
|
643 { |
|
644 return KErrOverflow; |
|
645 } |
|
646 TInt tag = KTag010E[ETagValue]; |
|
647 TInt ifd = KExifIfdZero; |
|
648 return iExifRead->GetParam8(tag, ifd, aParam); |
|
649 } |
|
650 |
|
651 /** |
|
652 Gets the copyright tag value of the metadata. |
|
653 |
|
654 @param aParam |
|
655 on return, the copyright value. |
|
656 |
|
657 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
658 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
659 |
|
660 @return error code |
|
661 KErrArgument if the requested data type does not match with the tag. |
|
662 KErrNotSupported if called on an encoding module. |
|
663 KErrNotFound if the tag cannot be found. |
|
664 KErrOverflow if there is an internal error with the Exif metadata. |
|
665 */ |
|
666 EXPORT_C TInt TExifReaderUtility::GetCopyright(HBufC8*& aParam) const |
|
667 { |
|
668 if(iExifRead==NULL) |
|
669 { |
|
670 return KErrOverflow; |
|
671 } |
|
672 TInt tag = KTag8298[ETagValue]; |
|
673 TInt ifd = KExifIfdZero; |
|
674 return iExifRead->GetParam8(tag, ifd, aParam); |
|
675 } |
|
676 |
|
677 /** |
|
678 Gets the maker note tag value of the metadata. |
|
679 |
|
680 @param aParam |
|
681 on return, the maker note value. |
|
682 |
|
683 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
684 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
685 |
|
686 @return error code |
|
687 KErrArgument if the requested data type does not match with the tag. |
|
688 KErrNotSupported if called on an encoding module. |
|
689 KErrNotFound if the tag cannot be found. |
|
690 KErrOverflow if there is an internal error with the Exif metadata. |
|
691 */ |
|
692 EXPORT_C TInt TExifReaderUtility::GetMakerNote(HBufC8*& aParam) const |
|
693 { |
|
694 if(iExifRead==NULL) |
|
695 { |
|
696 return KErrOverflow; |
|
697 } |
|
698 TInt tag = KTag927C[ETagValue]; |
|
699 TInt ifd = KExifIfdZero; |
|
700 return iExifRead->GetParam8(tag, ifd, aParam); |
|
701 } |
|
702 |
|
703 /** |
|
704 Gets the user comment tag value of the metadata. |
|
705 |
|
706 @param aParam |
|
707 on return, the user comment value. |
|
708 |
|
709 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
710 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
711 |
|
712 Note: The first 8 bytes of aParam may contain a Character Code to indicate the type of encoding used. See table 6 of the Exif 2.2 specification for a list of codes. |
|
713 |
|
714 @return error code |
|
715 KErrArgument if the requested data type does not match with the tag. |
|
716 KErrNotSupported if called on an encoding module. |
|
717 KErrNotFound if the tag cannot be found. |
|
718 KErrOverflow if there is an internal error with the Exif metadata. |
|
719 */ |
|
720 EXPORT_C TInt TExifReaderUtility::GetUserComment(HBufC8*& aParam) const |
|
721 { |
|
722 if(iExifRead==NULL) |
|
723 { |
|
724 return KErrOverflow; |
|
725 } |
|
726 TInt tag = KTag9286[ETagValue]; |
|
727 TInt ifd = KExifIfdZero; |
|
728 return iExifRead->GetParam8(tag, ifd, aParam); |
|
729 } |
|
730 |
|
731 /** |
|
732 Gets the flash tag value of the metadata. |
|
733 |
|
734 @param aParam |
|
735 on return, the flash value. |
|
736 |
|
737 @return error code |
|
738 KErrArgument if the requested data type does not match with the tag. |
|
739 KErrNotSupported if called on an encoding module. |
|
740 KErrNotFound if the tag cannot be found. |
|
741 KErrOverflow if there is an internal error with the Exif metadata. |
|
742 */ |
|
743 EXPORT_C TInt TExifReaderUtility::GetFlash(TUint16& aParam) const |
|
744 { |
|
745 if(iExifRead==NULL) |
|
746 { |
|
747 return KErrOverflow; |
|
748 } |
|
749 TInt tag = KTag9209[ETagValue]; |
|
750 TInt ifd = KExifIfdZero; |
|
751 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
752 } |
|
753 |
|
754 /** |
|
755 Gets the focal length tag value of the metadata. |
|
756 |
|
757 @param aNumerator |
|
758 on return, the focal length numerator value. |
|
759 |
|
760 @param aDenominator |
|
761 on return, the focal length denominator value. |
|
762 |
|
763 @return error code |
|
764 KErrArgument if the requested data type does not match with the tag. |
|
765 KErrNotSupported if called on an encoding module. |
|
766 KErrNotFound if the tag cannot be found. |
|
767 KErrOverflow if there is an internal error with the Exif metadata. |
|
768 */ |
|
769 EXPORT_C TInt TExifReaderUtility::GetFocalLength(TInt& aNumerator, TInt& aDenominator) const |
|
770 { |
|
771 if(iExifRead==NULL) |
|
772 { |
|
773 return KErrOverflow; |
|
774 } |
|
775 TInt tag = KTag920A[ETagValue]; |
|
776 TInt ifd = KExifIfdZero; |
|
777 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
778 } |
|
779 |
|
780 /** |
|
781 Gets the shutter speed tag value of the metadata. |
|
782 |
|
783 @param aNumerator |
|
784 on return, the shutter speed numerator value. |
|
785 |
|
786 Note that aNumerator is a true signed quantity, so no typecasting to an unsigned type is required. |
|
787 |
|
788 @param aDenominator |
|
789 on return, the shutter speed denominator value. |
|
790 |
|
791 Note that aDenominator is a true signed quantity, so no typecasting to an unsigned type is required. |
|
792 |
|
793 @return error code |
|
794 KErrArgument if the requested data type does not match with the tag. |
|
795 KErrNotSupported if called on an encoding module. |
|
796 KErrNotFound if the tag cannot be found. |
|
797 KErrOverflow if there is an internal error with the Exif metadata. |
|
798 */ |
|
799 EXPORT_C TInt TExifReaderUtility::GetShutterSpeedValue(TInt& aNumerator, TInt& aDenominator) const |
|
800 { |
|
801 if(iExifRead==NULL) |
|
802 { |
|
803 return KErrOverflow; |
|
804 } |
|
805 TInt tag = KTag9201[ETagValue]; |
|
806 TInt ifd = KExifIfdZero; |
|
807 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
808 } |
|
809 |
|
810 /** |
|
811 Gets the thumbnail jpeg interchange format length of the metadata. |
|
812 |
|
813 @deprecated - Replaced by TExifReaderUtility::GetJpegInterchangeFormatLength(TUint& aParam). |
|
814 |
|
815 @param aParam |
|
816 on return, the thumbnail jpeg interchange format length. |
|
817 |
|
818 @return error code |
|
819 KErrArgument if the requested data type does not match with the tag. |
|
820 KErrNotSupported if called on an encoding module. |
|
821 KErrNotFound if the tag cannot be found. |
|
822 KErrOverflow if there is an internal error with the Exif metadata. |
|
823 */ |
|
824 EXPORT_C TInt TExifReaderUtility::GetJpegInterchangeFormatLength(TInt& aParam) const |
|
825 { |
|
826 if(iExifRead==NULL) |
|
827 { |
|
828 return KErrOverflow; |
|
829 } |
|
830 TInt tag = KThumbTag0202[ETagValue]; |
|
831 TInt ifd = KExifIfdOne; |
|
832 return iExifRead->GetIntegerParam(tag, ifd, aParam); |
|
833 } |
|
834 |
|
835 /** |
|
836 Gets the thumbnail jpeg interchange format length of the metadata. |
|
837 |
|
838 @param aParam |
|
839 on return, the thumbnail jpeg interchange format length. |
|
840 |
|
841 @return error code |
|
842 KErrNotSupported if called on an encoding module. |
|
843 KErrNotFound if the tag cannot be found. |
|
844 KErrOverflow if there is an internal error with the Exif metadata. |
|
845 */ |
|
846 EXPORT_C TInt TExifReaderUtility::GetJpegInterchangeFormatLength(TUint& aParam) const |
|
847 { |
|
848 if(iExifRead==NULL) |
|
849 { |
|
850 return KErrOverflow; |
|
851 } |
|
852 TInt tag = KThumbTag0202[ETagValue]; |
|
853 TInt ifd = KExifIfdOne; |
|
854 TInt value = 0; |
|
855 TInt result = iExifRead->GetIntegerParam(tag, ifd, value); |
|
856 if (result == KErrNone) |
|
857 { |
|
858 aParam = static_cast<TUint>(value); |
|
859 } |
|
860 return result; |
|
861 } |
|
862 |
|
863 /** |
|
864 Gets the gps version id tag value of the metadata. |
|
865 |
|
866 @param aParam |
|
867 on return, the gps version id. |
|
868 |
|
869 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
870 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
871 |
|
872 @return error code |
|
873 KErrArgument if the requested data type does not match with the tag. |
|
874 KErrNotSupported if called on an encoding module. |
|
875 KErrNotFound if the tag cannot be found. |
|
876 KErrOverflow if there is an internal error with the Exif metadata. |
|
877 */ |
|
878 EXPORT_C TInt TExifReaderUtility::GetGpsVersionId(HBufC8*& aParam) const |
|
879 { |
|
880 if(iExifRead==NULL) |
|
881 { |
|
882 return KErrOverflow; |
|
883 } |
|
884 TInt tag = KTagGPS0000[ETagValue]; |
|
885 |
|
886 // We need to specify GPS sub IFD using the upper 16 bits. |
|
887 TUint ifd = KExifGpsIfd; |
|
888 |
|
889 return iExifRead->GetParam8(tag, ifd, aParam); |
|
890 } |
|
891 |
|
892 /** |
|
893 Gets the gps north or south latitude tag value of the metadata. |
|
894 |
|
895 @param aParam |
|
896 on return, the gps north or south latitude. |
|
897 |
|
898 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
899 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
900 |
|
901 @return error code |
|
902 KErrArgument if the requested data type does not match with the tag. |
|
903 KErrNotSupported if called on an encoding module. |
|
904 KErrNotFound if the tag cannot be found. |
|
905 KErrOverflow if there is an internal error with the Exif metadata. |
|
906 */ |
|
907 EXPORT_C TInt TExifReaderUtility::GetGpsLatitudeRef(HBufC8*& aParam) const |
|
908 { |
|
909 if(iExifRead==NULL) |
|
910 { |
|
911 return KErrOverflow; |
|
912 } |
|
913 TInt tag = KTagGPS0001[ETagValue]; |
|
914 |
|
915 // We need to specify GPS sub IFD using the upper 16 bits. |
|
916 TUint ifd = KExifGpsIfd; |
|
917 |
|
918 return iExifRead->GetParam8(tag, ifd, aParam); |
|
919 } |
|
920 |
|
921 /** |
|
922 Gets the gps latitude tag value of the metadata. |
|
923 |
|
924 @param aDegNumerator |
|
925 on return, the degrees latitude numerator value. |
|
926 |
|
927 @param aDegDenominator |
|
928 on return, the degrees latitude denominator value. |
|
929 |
|
930 @param aMinNumerator |
|
931 on return, the minutes latitude numerator value. |
|
932 |
|
933 @param aMinDenominator |
|
934 on return, the minutes latitude denominator value. |
|
935 |
|
936 @param aSecNumerator |
|
937 on return, the seconds latitude numerator value. |
|
938 |
|
939 @param aSecDenominator |
|
940 on return, the seconds latitude denominator value. |
|
941 |
|
942 @return error code |
|
943 KErrArgument if the requested data type does not match with the tag. |
|
944 KErrNotSupported if called on an encoding module. |
|
945 KErrNotFound if the tag cannot be found. |
|
946 KErrOverflow if there is an internal error with the Exif metadata. |
|
947 KErrNoMemory if there was not enough memory available to complete the request. |
|
948 KErrCorrupt if the gps latitude tag value of the metadata is corrupt. |
|
949 */ |
|
950 EXPORT_C TInt TExifReaderUtility::GetGpsLatitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const |
|
951 { |
|
952 if(iExifRead==NULL) |
|
953 { |
|
954 return KErrOverflow; |
|
955 } |
|
956 TInt tag = KTagGPS0002[ETagValue]; |
|
957 TInt count = KTagGPS0002[EComponentCountValue]; |
|
958 |
|
959 // We need to specify GPS sub IFD using the upper 16 bits. |
|
960 TUint ifd = KExifGpsIfd; |
|
961 |
|
962 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
963 if (param == NULL) |
|
964 { |
|
965 return KErrNoMemory; |
|
966 } |
|
967 |
|
968 TInt result = iExifRead->GetRationalArrayParam(tag, ifd, *param); |
|
969 if (result==KErrNone) |
|
970 { |
|
971 if(param->Count()!=count) |
|
972 { |
|
973 result=KErrCorrupt; |
|
974 } |
|
975 else |
|
976 { |
|
977 aDegNumerator = param->At(0).iNumerator; |
|
978 aDegDenominator = param->At(0).iDenominator; |
|
979 aMinNumerator = param->At(1).iNumerator; |
|
980 aMinDenominator = param->At(1).iDenominator; |
|
981 aSecNumerator = param->At(2).iNumerator; |
|
982 aSecDenominator = param->At(2).iDenominator; |
|
983 } |
|
984 } |
|
985 |
|
986 delete param; |
|
987 return result; |
|
988 } |
|
989 |
|
990 /** |
|
991 Gets the gps east or west longitude tag value of the metadata. |
|
992 |
|
993 @param aParam |
|
994 on return, the gps east or west longitude. |
|
995 |
|
996 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
997 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
998 |
|
999 @return error code |
|
1000 KErrArgument if the requested data type does not match with the tag. |
|
1001 KErrNotSupported if called on an encoding module. |
|
1002 KErrNotFound if the tag cannot be found. |
|
1003 KErrOverflow if there is an internal error with the Exif metadata. |
|
1004 */ |
|
1005 EXPORT_C TInt TExifReaderUtility::GetGpsLongitudeRef(HBufC8*& aParam) const |
|
1006 { |
|
1007 if(iExifRead==NULL) |
|
1008 { |
|
1009 return KErrOverflow; |
|
1010 } |
|
1011 TInt tag = KTagGPS0003[ETagValue]; |
|
1012 |
|
1013 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1014 TUint ifd = KExifGpsIfd; |
|
1015 |
|
1016 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1017 } |
|
1018 |
|
1019 /** |
|
1020 Gets the gps longitude tag value of the metadata. |
|
1021 |
|
1022 @param aDegNumerator |
|
1023 on return, the degrees longitude numerator value. |
|
1024 |
|
1025 @param aDegDenominator |
|
1026 on return, the degrees longitude denominator value. |
|
1027 |
|
1028 @param aMinNumerator |
|
1029 on return, the minutes longitude numerator value. |
|
1030 |
|
1031 @param aMinDenominator |
|
1032 on return, the minutes longitude denominator value. |
|
1033 |
|
1034 @param aSecNumerator |
|
1035 on return, the seconds longitude numerator value. |
|
1036 |
|
1037 @param aSecDenominator |
|
1038 on return, the seconds longitude denominator value. |
|
1039 |
|
1040 @return error code |
|
1041 KErrArgument if the requested data type does not match with the tag. |
|
1042 KErrNotSupported if called on an encoding module. |
|
1043 KErrNotFound if the tag cannot be found. |
|
1044 KErrOverflow if there is an internal error with the Exif metadata. |
|
1045 KErrNoMemory if there was not enough memory available to complete the request. |
|
1046 KErrCorrupt if the gps longitude tag value of the metadata is corrupt. |
|
1047 */ |
|
1048 EXPORT_C TInt TExifReaderUtility::GetGpsLongitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const |
|
1049 { |
|
1050 if(iExifRead==NULL) |
|
1051 { |
|
1052 return KErrOverflow; |
|
1053 } |
|
1054 TInt tag = KTagGPS0004[ETagValue]; |
|
1055 TInt count = KTagGPS0004[EComponentCountValue]; |
|
1056 |
|
1057 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1058 TUint ifd = KExifGpsIfd; |
|
1059 |
|
1060 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
1061 if (param == NULL) |
|
1062 { |
|
1063 return KErrNoMemory; |
|
1064 } |
|
1065 |
|
1066 TInt result = iExifRead->GetRationalArrayParam(tag, ifd, *param); |
|
1067 if (result==KErrNone) |
|
1068 { |
|
1069 if(param->Count()!=count) |
|
1070 { |
|
1071 result=KErrCorrupt; |
|
1072 } |
|
1073 else |
|
1074 { |
|
1075 aDegNumerator = param->At(0).iNumerator; |
|
1076 aDegDenominator = param->At(0).iDenominator; |
|
1077 aMinNumerator = param->At(1).iNumerator; |
|
1078 aMinDenominator = param->At(1).iDenominator; |
|
1079 aSecNumerator = param->At(2).iNumerator; |
|
1080 aSecDenominator = param->At(2).iDenominator; |
|
1081 } |
|
1082 } |
|
1083 |
|
1084 delete param; |
|
1085 return result; |
|
1086 } |
|
1087 |
|
1088 /** |
|
1089 Gets the gps altitude reference tag value of the metadata. |
|
1090 |
|
1091 @param aParam |
|
1092 on return, the gps altitude reference. |
|
1093 |
|
1094 @return error code |
|
1095 KErrArgument if the requested data type does not match with the tag. |
|
1096 KErrNotSupported if called on an encoding module. |
|
1097 KErrNotFound if the tag cannot be found. |
|
1098 KErrOverflow if there is an internal error with the Exif metadata. |
|
1099 KErrNoMemory if there was not enough memory available to complete the request. |
|
1100 */ |
|
1101 EXPORT_C TInt TExifReaderUtility::GetGpsAltitudeRef(TUint8& aParam) const |
|
1102 { |
|
1103 if(iExifRead==NULL) |
|
1104 { |
|
1105 return KErrOverflow; |
|
1106 } |
|
1107 TInt tag = KTagGPS0005[ETagValue]; |
|
1108 TInt count = KTagGPS0005[EComponentCountValue]; |
|
1109 |
|
1110 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1111 TUint ifd = KExifGpsIfd; |
|
1112 |
|
1113 HBufC8* data = NULL; |
|
1114 TRAPD(err, data=HBufC8::NewL(count)); |
|
1115 if (err!=KErrNone) |
|
1116 { |
|
1117 return KErrNoMemory; |
|
1118 } |
|
1119 TInt result = iExifRead->GetParam8(tag, ifd, data); |
|
1120 if (result==KErrNone) |
|
1121 { |
|
1122 aParam = static_cast<TUint8>((*data)[0]); |
|
1123 } |
|
1124 delete data; |
|
1125 return result; |
|
1126 } |
|
1127 |
|
1128 /** |
|
1129 Gets the gps altitude tag value of the metadata. |
|
1130 |
|
1131 @param aNumerator |
|
1132 on return, the gps altitude numerator value. |
|
1133 |
|
1134 @param aDenominator |
|
1135 on return, the gps altitude denominator value. |
|
1136 |
|
1137 @return error code |
|
1138 KErrArgument if the requested data type does not match with the tag. |
|
1139 KErrNotSupported if called on an encoding module. |
|
1140 KErrNotFound if the tag cannot be found. |
|
1141 KErrOverflow if there is an internal error with the Exif metadata. |
|
1142 */ |
|
1143 EXPORT_C TInt TExifReaderUtility::GetGpsAltitude(TInt& aNumerator, TInt& aDenominator) const |
|
1144 { |
|
1145 if(iExifRead==NULL) |
|
1146 { |
|
1147 return KErrOverflow; |
|
1148 } |
|
1149 TInt tag = KTagGPS0006[ETagValue]; |
|
1150 |
|
1151 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1152 TUint ifd = KExifGpsIfd; |
|
1153 |
|
1154 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1155 } |
|
1156 |
|
1157 /** |
|
1158 Gets the gps time tag value of the metadata. |
|
1159 |
|
1160 @param aHourNumerator |
|
1161 on return, the gps hour numerator value. |
|
1162 |
|
1163 @param aHourDenominator |
|
1164 on return, the gps hour denominator value. |
|
1165 |
|
1166 @param aMinNumerator |
|
1167 on return, the gps minutes numerator value. |
|
1168 |
|
1169 @param aMinDenominator |
|
1170 on return, the gps minutes denominator value. |
|
1171 |
|
1172 @param aSecNumerator |
|
1173 on return, the gps seconds numerator value. |
|
1174 |
|
1175 @param aSecDenominator |
|
1176 on return, the gps seconds denominator value. |
|
1177 |
|
1178 @return error code |
|
1179 KErrArgument if the requested data type does not match with the tag. |
|
1180 KErrNotSupported if called on an encoding module. |
|
1181 KErrNotFound if the tag cannot be found. |
|
1182 KErrOverflow if there is an internal error with the Exif metadata. |
|
1183 KErrNoMemory if there was not enough memory available to complete the request. |
|
1184 KErrCorrupt if the gps longitude tag value of the metadata is corrupt. |
|
1185 */ |
|
1186 EXPORT_C TInt TExifReaderUtility::GetGpsTimeStamp(TInt& aHourNumerator, TInt& aHourDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const |
|
1187 { |
|
1188 if(iExifRead==NULL) |
|
1189 { |
|
1190 return KErrOverflow; |
|
1191 } |
|
1192 TInt tag = KTagGPS0007[ETagValue]; |
|
1193 TInt count = KTagGPS0007[EComponentCountValue]; |
|
1194 |
|
1195 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1196 TUint ifd = KExifGpsIfd; |
|
1197 |
|
1198 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
1199 if (param == NULL) |
|
1200 { |
|
1201 return KErrNoMemory; |
|
1202 } |
|
1203 |
|
1204 TInt result = iExifRead->GetRationalArrayParam(tag, ifd, *param); |
|
1205 if (result==KErrNone) |
|
1206 { |
|
1207 if(param->Count()!=count) |
|
1208 { |
|
1209 result=KErrCorrupt; |
|
1210 } |
|
1211 else |
|
1212 { |
|
1213 aHourNumerator = param->At(0).iNumerator; |
|
1214 aHourDenominator = param->At(0).iDenominator; |
|
1215 aMinNumerator = param->At(1).iNumerator; |
|
1216 aMinDenominator = param->At(1).iDenominator; |
|
1217 aSecNumerator = param->At(2).iNumerator; |
|
1218 aSecDenominator = param->At(2).iDenominator; |
|
1219 } |
|
1220 } |
|
1221 |
|
1222 delete param; |
|
1223 return result; |
|
1224 } |
|
1225 |
|
1226 /** |
|
1227 Gets the gps satellites used for measurement tag value of the metadata. |
|
1228 |
|
1229 @param aParam |
|
1230 on return, the gps satellites used for measurement value. |
|
1231 |
|
1232 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1233 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1234 |
|
1235 @return error code |
|
1236 KErrArgument if the requested data type does not match with the tag. |
|
1237 KErrNotSupported if called on an encoding module. |
|
1238 KErrNotFound if the tag cannot be found. |
|
1239 KErrOverflow if there is an internal error with the Exif metadata. |
|
1240 */ |
|
1241 EXPORT_C TInt TExifReaderUtility::GetGpsSatellites(HBufC8*& aParam) const |
|
1242 { |
|
1243 if(iExifRead==NULL) |
|
1244 { |
|
1245 return KErrOverflow; |
|
1246 } |
|
1247 TInt tag = KTagGPS0008[ETagValue]; |
|
1248 |
|
1249 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1250 TUint ifd = KExifGpsIfd; |
|
1251 |
|
1252 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1253 } |
|
1254 |
|
1255 /** |
|
1256 Gets the gps receiver status tag value of the metadata. |
|
1257 |
|
1258 @param aParam |
|
1259 on return, the gps receiver status value. |
|
1260 |
|
1261 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1262 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1263 |
|
1264 @return error code |
|
1265 KErrArgument if the requested data type does not match with the tag. |
|
1266 KErrNotSupported if called on an encoding module. |
|
1267 KErrNotFound if the tag cannot be found. |
|
1268 KErrOverflow if there is an internal error with the Exif metadata. |
|
1269 */ |
|
1270 EXPORT_C TInt TExifReaderUtility::GetGpsStatus(HBufC8*& aParam) const |
|
1271 { |
|
1272 if(iExifRead==NULL) |
|
1273 { |
|
1274 return KErrOverflow; |
|
1275 } |
|
1276 TInt tag = KTagGPS0009[ETagValue]; |
|
1277 |
|
1278 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1279 TUint ifd = KExifGpsIfd; |
|
1280 |
|
1281 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1282 } |
|
1283 |
|
1284 /** |
|
1285 Gets the gps measurement mode tag value of the metadata. |
|
1286 |
|
1287 @param aParam |
|
1288 on return, the gps measurement mode value. |
|
1289 |
|
1290 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1291 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1292 |
|
1293 @return error code |
|
1294 KErrArgument if the requested data type does not match with the tag. |
|
1295 KErrNotSupported if called on an encoding module. |
|
1296 KErrNotFound if the tag cannot be found. |
|
1297 KErrOverflow if there is an internal error with the Exif metadata. |
|
1298 */ |
|
1299 EXPORT_C TInt TExifReaderUtility::GetGpsMeasureMode(HBufC8*& aParam) const |
|
1300 { |
|
1301 if(iExifRead==NULL) |
|
1302 { |
|
1303 return KErrOverflow; |
|
1304 } |
|
1305 TInt tag = KTagGPS000A[ETagValue]; |
|
1306 |
|
1307 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1308 TUint ifd = KExifGpsIfd; |
|
1309 |
|
1310 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1311 } |
|
1312 |
|
1313 /** |
|
1314 Gets the gps measurement precision tag value of the metadata. |
|
1315 |
|
1316 @param aNumerator |
|
1317 on return, the gps measurement precision numerator value. |
|
1318 |
|
1319 @param aDenominator |
|
1320 on return, the gps measurement precision denominator value. |
|
1321 |
|
1322 @return error code |
|
1323 KErrArgument if the requested data type does not match with the tag. |
|
1324 KErrNotSupported if called on an encoding module. |
|
1325 KErrNotFound if the tag cannot be found. |
|
1326 KErrOverflow if there is an internal error with the Exif metadata. |
|
1327 */ |
|
1328 EXPORT_C TInt TExifReaderUtility::GetGpsDop(TInt& aNumerator, TInt& aDenominator) const |
|
1329 { |
|
1330 if(iExifRead==NULL) |
|
1331 { |
|
1332 return KErrOverflow; |
|
1333 } |
|
1334 TInt tag = KTagGPS000B[ETagValue]; |
|
1335 |
|
1336 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1337 TUint ifd = KExifGpsIfd; |
|
1338 |
|
1339 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1340 } |
|
1341 |
|
1342 /** |
|
1343 Gets the gps speed unit tag value of the metadata. |
|
1344 |
|
1345 @param aParam |
|
1346 on return, the gps speed unit value. |
|
1347 |
|
1348 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1349 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1350 |
|
1351 @return error code |
|
1352 KErrArgument if the requested data type does not match with the tag. |
|
1353 KErrNotSupported if called on an encoding module. |
|
1354 KErrNotFound if the tag cannot be found. |
|
1355 KErrOverflow if there is an internal error with the Exif metadata. |
|
1356 */ |
|
1357 EXPORT_C TInt TExifReaderUtility::GetGpsSpeedRef(HBufC8*& aParam) const |
|
1358 { |
|
1359 if(iExifRead==NULL) |
|
1360 { |
|
1361 return KErrOverflow; |
|
1362 } |
|
1363 TInt tag = KTagGPS000C[ETagValue]; |
|
1364 |
|
1365 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1366 TUint ifd = KExifGpsIfd; |
|
1367 |
|
1368 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1369 } |
|
1370 |
|
1371 /** |
|
1372 Gets the speed of gps receiver tag value of the metadata. |
|
1373 |
|
1374 @param aNumerator |
|
1375 on return, the speed of gps receiver numerator value. |
|
1376 |
|
1377 @param aDenominator |
|
1378 on return, the speed of gps receiver denominator value. |
|
1379 |
|
1380 @return error code |
|
1381 KErrArgument if the requested data type does not match with the tag. |
|
1382 KErrNotSupported if called on an encoding module. |
|
1383 KErrNotFound if the tag cannot be found. |
|
1384 KErrOverflow if there is an internal error with the Exif metadata. |
|
1385 */ |
|
1386 EXPORT_C TInt TExifReaderUtility::GetGpsSpeed(TInt& aNumerator, TInt& aDenominator) const |
|
1387 { |
|
1388 if(iExifRead==NULL) |
|
1389 { |
|
1390 return KErrOverflow; |
|
1391 } |
|
1392 TInt tag = KTagGPS000D[ETagValue]; |
|
1393 |
|
1394 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1395 TUint ifd = KExifGpsIfd; |
|
1396 |
|
1397 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1398 } |
|
1399 |
|
1400 /** |
|
1401 Gets the gps reference for direction of movement tag value of the metadata. |
|
1402 |
|
1403 @param aParam |
|
1404 on return, the gps reference for direction of movement value. |
|
1405 |
|
1406 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1407 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1408 |
|
1409 @return error code |
|
1410 KErrArgument if the requested data type does not match with the tag. |
|
1411 KErrNotSupported if called on an encoding module. |
|
1412 KErrNotFound if the tag cannot be found. |
|
1413 KErrOverflow if there is an internal error with the Exif metadata. |
|
1414 */ |
|
1415 EXPORT_C TInt TExifReaderUtility::GetGpsTrackRef(HBufC8*& aParam) const |
|
1416 { |
|
1417 if(iExifRead==NULL) |
|
1418 { |
|
1419 return KErrOverflow; |
|
1420 } |
|
1421 TInt tag = KTagGPS000E[ETagValue]; |
|
1422 |
|
1423 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1424 TUint ifd = KExifGpsIfd; |
|
1425 |
|
1426 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1427 } |
|
1428 |
|
1429 /** |
|
1430 Gets the gps direction of movement tag value of the metadata. |
|
1431 |
|
1432 @param aNumerator |
|
1433 on return, the gps direction of movement numerator value. |
|
1434 |
|
1435 @param aDenominator |
|
1436 on return, the gps direction of movement denominator value. |
|
1437 |
|
1438 @return error code |
|
1439 KErrArgument if the requested data type does not match with the tag. |
|
1440 KErrNotSupported if called on an encoding module. |
|
1441 KErrNotFound if the tag cannot be found. |
|
1442 KErrOverflow if there is an internal error with the Exif metadata. |
|
1443 */ |
|
1444 EXPORT_C TInt TExifReaderUtility::GetGpsTrack(TInt& aNumerator, TInt& aDenominator) const |
|
1445 { |
|
1446 if(iExifRead==NULL) |
|
1447 { |
|
1448 return KErrOverflow; |
|
1449 } |
|
1450 TInt tag = KTagGPS000F[ETagValue]; |
|
1451 |
|
1452 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1453 TUint ifd = KExifGpsIfd; |
|
1454 |
|
1455 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1456 } |
|
1457 |
|
1458 /** |
|
1459 Gets the gps reference for direction of image tag value of the metadata. |
|
1460 |
|
1461 @param aParam |
|
1462 on return, the gps reference for direction of image value. |
|
1463 |
|
1464 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1465 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1466 |
|
1467 @return error code |
|
1468 KErrArgument if the requested data type does not match with the tag. |
|
1469 KErrNotSupported if called on an encoding module. |
|
1470 KErrNotFound if the tag cannot be found. |
|
1471 KErrOverflow if there is an internal error with the Exif metadata. |
|
1472 */ |
|
1473 EXPORT_C TInt TExifReaderUtility::GetGpsImgDirectionRef(HBufC8*& aParam) const |
|
1474 { |
|
1475 if(iExifRead==NULL) |
|
1476 { |
|
1477 return KErrOverflow; |
|
1478 } |
|
1479 TInt tag = KTagGPS0010[ETagValue]; |
|
1480 |
|
1481 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1482 TUint ifd = KExifGpsIfd; |
|
1483 |
|
1484 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1485 } |
|
1486 |
|
1487 /** |
|
1488 Gets the gps direction of image tag value of the metadata. |
|
1489 |
|
1490 @param aNumerator |
|
1491 on return, the gps direction of image numerator value. |
|
1492 |
|
1493 @param aDenominator |
|
1494 on return, the gps direction of image denominator value. |
|
1495 |
|
1496 @return error code |
|
1497 KErrArgument if the requested data type does not match with the tag. |
|
1498 KErrNotSupported if called on an encoding module. |
|
1499 KErrNotFound if the tag cannot be found. |
|
1500 KErrOverflow if there is an internal error with the Exif metadata. |
|
1501 */ |
|
1502 EXPORT_C TInt TExifReaderUtility::GetGpsImgDirection(TInt& aNumerator, TInt& aDenominator) const |
|
1503 { |
|
1504 if(iExifRead==NULL) |
|
1505 { |
|
1506 return KErrOverflow; |
|
1507 } |
|
1508 TInt tag = KTagGPS0011[ETagValue]; |
|
1509 |
|
1510 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1511 TUint ifd = KExifGpsIfd; |
|
1512 |
|
1513 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1514 } |
|
1515 |
|
1516 /** |
|
1517 Gets the gps geodetic survey data used tag value of the metadata. |
|
1518 |
|
1519 @param aParam |
|
1520 on return, the geodetic survey data used value. |
|
1521 |
|
1522 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1523 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1524 |
|
1525 @return error code |
|
1526 KErrArgument if the requested data type does not match with the tag. |
|
1527 KErrNotSupported if called on an encoding module. |
|
1528 KErrNotFound if the tag cannot be found. |
|
1529 KErrOverflow if there is an internal error with the Exif metadata. |
|
1530 */ |
|
1531 EXPORT_C TInt TExifReaderUtility::GetGpsMapDatum(HBufC8*& aParam) const |
|
1532 { |
|
1533 if(iExifRead==NULL) |
|
1534 { |
|
1535 return KErrOverflow; |
|
1536 } |
|
1537 TInt tag = KTagGPS0012[ETagValue]; |
|
1538 |
|
1539 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1540 TUint ifd = KExifGpsIfd; |
|
1541 |
|
1542 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1543 } |
|
1544 |
|
1545 /** |
|
1546 Gets the gps reference for latitude of destination tag value of the metadata. |
|
1547 |
|
1548 @param aParam |
|
1549 on return, the reference for latitude of destination value. |
|
1550 |
|
1551 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1552 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1553 |
|
1554 @return error code |
|
1555 KErrArgument if the requested data type does not match with the tag. |
|
1556 KErrNotSupported if called on an encoding module. |
|
1557 KErrNotFound if the tag cannot be found. |
|
1558 KErrOverflow if there is an internal error with the Exif metadata. |
|
1559 */ |
|
1560 EXPORT_C TInt TExifReaderUtility::GetGpsDestLatitudeRef(HBufC8*& aParam) const |
|
1561 { |
|
1562 if(iExifRead==NULL) |
|
1563 { |
|
1564 return KErrOverflow; |
|
1565 } |
|
1566 TInt tag = KTagGPS0013[ETagValue]; |
|
1567 |
|
1568 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1569 TUint ifd = KExifGpsIfd; |
|
1570 |
|
1571 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1572 } |
|
1573 |
|
1574 /** |
|
1575 Gets the gps latitude of destination tag value of the metadata. |
|
1576 |
|
1577 @param aDegNumerator |
|
1578 on return, the degrees latitude of destination numerator value. |
|
1579 |
|
1580 @param aDegDenominator |
|
1581 on return, the degrees latitude of destination denominator value. |
|
1582 |
|
1583 @param aMinNumerator |
|
1584 on return, the minutes latitude of destination numerator value. |
|
1585 |
|
1586 @param aMinDenominator |
|
1587 on return, the minutes latitude of destination denominator value. |
|
1588 |
|
1589 @param aSecNumerator |
|
1590 on return, the seconds latitude of destination numerator value. |
|
1591 |
|
1592 @param aSecDenominator |
|
1593 on return, the seconds latitude of destination denominator value. |
|
1594 |
|
1595 @return error code |
|
1596 KErrArgument if the requested data type does not match with the tag. |
|
1597 KErrNotSupported if called on an encoding module. |
|
1598 KErrNotFound if the tag cannot be found. |
|
1599 KErrOverflow if there is an internal error with the Exif metadata. |
|
1600 */ |
|
1601 EXPORT_C TInt TExifReaderUtility::GetGpsDestLatitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const |
|
1602 { |
|
1603 if(iExifRead==NULL) |
|
1604 { |
|
1605 return KErrOverflow; |
|
1606 } |
|
1607 TInt tag = KTagGPS0014[ETagValue]; |
|
1608 TInt count = KTagGPS0014[EComponentCountValue]; |
|
1609 |
|
1610 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1611 TUint ifd = KExifGpsIfd; |
|
1612 |
|
1613 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
1614 if (param == NULL) |
|
1615 { |
|
1616 return KErrNoMemory; |
|
1617 } |
|
1618 |
|
1619 TInt result = iExifRead->GetRationalArrayParam(tag, ifd, *param); |
|
1620 if (result==KErrNone) |
|
1621 { |
|
1622 if(param->Count()!=count) |
|
1623 { |
|
1624 result=KErrCorrupt; |
|
1625 } |
|
1626 else |
|
1627 { |
|
1628 aDegNumerator = param->At(0).iNumerator; |
|
1629 aDegDenominator = param->At(0).iDenominator; |
|
1630 aMinNumerator = param->At(1).iNumerator; |
|
1631 aMinDenominator = param->At(1).iDenominator; |
|
1632 aSecNumerator = param->At(2).iNumerator; |
|
1633 aSecDenominator = param->At(2).iDenominator; |
|
1634 } |
|
1635 } |
|
1636 |
|
1637 delete param; |
|
1638 return result; |
|
1639 } |
|
1640 |
|
1641 /** |
|
1642 Gets the gps reference for longitude of destination tag value of the metadata. |
|
1643 |
|
1644 @param aParam |
|
1645 on return, the gps reference for longitude of destination value. |
|
1646 |
|
1647 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1648 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1649 |
|
1650 @return error code |
|
1651 KErrArgument if the requested data type does not match with the tag. |
|
1652 KErrNotSupported if called on an encoding module. |
|
1653 KErrNotFound if the tag cannot be found. |
|
1654 KErrOverflow if there is an internal error with the Exif metadata. |
|
1655 */ |
|
1656 EXPORT_C TInt TExifReaderUtility::GetGpsDestLongitudeRef(HBufC8*& aParam) const |
|
1657 { |
|
1658 if(iExifRead==NULL) |
|
1659 { |
|
1660 return KErrOverflow; |
|
1661 } |
|
1662 TInt tag = KTagGPS0015[ETagValue]; |
|
1663 |
|
1664 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1665 TUint ifd = KExifGpsIfd; |
|
1666 |
|
1667 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1668 } |
|
1669 |
|
1670 /** |
|
1671 Gets the gps longitude of destination tag value of the metadata. |
|
1672 |
|
1673 @param aDegNumerator |
|
1674 on return, the degrees longitude of destination numerator value. |
|
1675 |
|
1676 @param aDegDenominator |
|
1677 on return, the degrees longitude of destination denominator value. |
|
1678 |
|
1679 @param aMinNumerator |
|
1680 on return, the minutes longitude of destination numerator value. |
|
1681 |
|
1682 @param aMinDenominator |
|
1683 on return, the minutes longitude of destination denominator value. |
|
1684 |
|
1685 @param aSecNumerator |
|
1686 on return, the seconds longitude of destination numerator value. |
|
1687 |
|
1688 @param aSecDenominator |
|
1689 on return, the seconds longitude of destination denominator value. |
|
1690 |
|
1691 @return error code |
|
1692 KErrArgument if the requested data type does not match with the tag. |
|
1693 KErrNotSupported if called on an encoding module. |
|
1694 KErrNotFound if the tag cannot be found. |
|
1695 KErrOverflow if there is an internal error with the Exif metadata. |
|
1696 */ |
|
1697 EXPORT_C TInt TExifReaderUtility::GetGpsDestLongitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const |
|
1698 { |
|
1699 if(iExifRead==NULL) |
|
1700 { |
|
1701 return KErrOverflow; |
|
1702 } |
|
1703 TInt tag = KTagGPS0016[ETagValue]; |
|
1704 TInt count = KTagGPS0016[EComponentCountValue]; |
|
1705 |
|
1706 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1707 TUint ifd = KExifGpsIfd; |
|
1708 |
|
1709 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
1710 if (param == NULL) |
|
1711 { |
|
1712 return KErrNoMemory; |
|
1713 } |
|
1714 |
|
1715 TInt result = iExifRead->GetRationalArrayParam(tag, ifd, *param); |
|
1716 if (result==KErrNone) |
|
1717 { |
|
1718 if(param->Count()!=count) |
|
1719 { |
|
1720 result=KErrCorrupt; |
|
1721 } |
|
1722 else |
|
1723 { |
|
1724 aDegNumerator = param->At(0).iNumerator; |
|
1725 aDegDenominator = param->At(0).iDenominator; |
|
1726 aMinNumerator = param->At(1).iNumerator; |
|
1727 aMinDenominator = param->At(1).iDenominator; |
|
1728 aSecNumerator = param->At(2).iNumerator; |
|
1729 aSecDenominator = param->At(2).iDenominator; |
|
1730 } |
|
1731 } |
|
1732 |
|
1733 delete param; |
|
1734 return result; |
|
1735 } |
|
1736 |
|
1737 /** |
|
1738 Gets the gps reference for bearing of destination tag value of the metadata. |
|
1739 |
|
1740 @param aParam |
|
1741 on return, the reference for bearing of destination value. |
|
1742 |
|
1743 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1744 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1745 |
|
1746 @return error code |
|
1747 KErrArgument if the requested data type does not match with the tag. |
|
1748 KErrNotSupported if called on an encoding module. |
|
1749 KErrNotFound if the tag cannot be found. |
|
1750 KErrOverflow if there is an internal error with the Exif metadata. |
|
1751 */ |
|
1752 EXPORT_C TInt TExifReaderUtility::GetGpsDestBearingRef(HBufC8*& aParam) const |
|
1753 { |
|
1754 if(iExifRead==NULL) |
|
1755 { |
|
1756 return KErrOverflow; |
|
1757 } |
|
1758 TInt tag = KTagGPS0017[ETagValue]; |
|
1759 |
|
1760 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1761 TUint ifd = KExifGpsIfd; |
|
1762 |
|
1763 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1764 } |
|
1765 |
|
1766 /** |
|
1767 Gets the gps bearing of destination tag value of the metadata. |
|
1768 |
|
1769 @param aNumerator |
|
1770 on return, the bearing of destination numerator value. |
|
1771 |
|
1772 @param aDenominator |
|
1773 on return, the bearing of destination denominator value. |
|
1774 |
|
1775 @return error code |
|
1776 KErrArgument if the requested data type does not match with the tag. |
|
1777 KErrNotSupported if called on an encoding module. |
|
1778 KErrNotFound if the tag cannot be found. |
|
1779 KErrOverflow if there is an internal error with the Exif metadata. |
|
1780 */ |
|
1781 EXPORT_C TInt TExifReaderUtility::GetGpsDestBearing(TInt& aNumerator, TInt& aDenominator) const |
|
1782 { |
|
1783 if(iExifRead==NULL) |
|
1784 { |
|
1785 return KErrOverflow; |
|
1786 } |
|
1787 TInt tag = KTagGPS0018[ETagValue]; |
|
1788 |
|
1789 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1790 TUint ifd = KExifGpsIfd; |
|
1791 |
|
1792 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1793 } |
|
1794 |
|
1795 /** |
|
1796 Gets the gps reference for distance to destination tag value of the metadata. |
|
1797 |
|
1798 @param aParam |
|
1799 on return, the reference for distance to destination value. |
|
1800 |
|
1801 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1802 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1803 |
|
1804 @return error code |
|
1805 KErrArgument if the requested data type does not match with the tag. |
|
1806 KErrNotSupported if called on an encoding module. |
|
1807 KErrNotFound if the tag cannot be found. |
|
1808 KErrOverflow if there is an internal error with the Exif metadata. |
|
1809 */ |
|
1810 EXPORT_C TInt TExifReaderUtility::GetGpsDestDistanceRef(HBufC8*& aParam) const |
|
1811 { |
|
1812 if(iExifRead==NULL) |
|
1813 { |
|
1814 return KErrOverflow; |
|
1815 } |
|
1816 TInt tag = KTagGPS0019[ETagValue]; |
|
1817 |
|
1818 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1819 TUint ifd = KExifGpsIfd; |
|
1820 |
|
1821 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1822 } |
|
1823 |
|
1824 /** |
|
1825 Gets the gps distance to destination tag value of the metadata. |
|
1826 |
|
1827 @param aNumerator |
|
1828 on return, the distance to destination numerator value. |
|
1829 |
|
1830 @param aDenominator |
|
1831 on return, the distance to destination denominator value. |
|
1832 |
|
1833 @return error code |
|
1834 KErrArgument if the requested data type does not match with the tag. |
|
1835 KErrNotSupported if called on an encoding module. |
|
1836 KErrNotFound if the tag cannot be found. |
|
1837 KErrOverflow if there is an internal error with the Exif metadata. |
|
1838 */ |
|
1839 EXPORT_C TInt TExifReaderUtility::GetGpsDestDistance(TInt& aNumerator, TInt& aDenominator) const |
|
1840 { |
|
1841 if(iExifRead==NULL) |
|
1842 { |
|
1843 return KErrOverflow; |
|
1844 } |
|
1845 TInt tag = KTagGPS001A[ETagValue]; |
|
1846 |
|
1847 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1848 TUint ifd = KExifGpsIfd; |
|
1849 |
|
1850 return iExifRead->GetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
1851 } |
|
1852 |
|
1853 /** |
|
1854 Gets the name of gps processing method tag value of the metadata. |
|
1855 |
|
1856 @param aParam |
|
1857 on return, the name of gps processing method value. |
|
1858 |
|
1859 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1860 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1861 |
|
1862 Note: According to the Exif 2.2 specification, the first 8 bytes of aParam should contain a Character Code to indicate the type of encoding used. See table 6 of the Exif 2.2 specification for a list of codes. |
|
1863 |
|
1864 @return error code |
|
1865 KErrArgument if the requested data type does not match with the tag. |
|
1866 KErrNotSupported if called on an encoding module. |
|
1867 KErrNotFound if the tag cannot be found. |
|
1868 KErrOverflow if there is an internal error with the Exif metadata. |
|
1869 */ |
|
1870 EXPORT_C TInt TExifReaderUtility::GetGpsProcessingMethod(HBufC8*& aParam) const |
|
1871 { |
|
1872 if(iExifRead==NULL) |
|
1873 { |
|
1874 return KErrOverflow; |
|
1875 } |
|
1876 TInt tag = KTagGPS001B[ETagValue]; |
|
1877 |
|
1878 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1879 TUint ifd = KExifGpsIfd; |
|
1880 |
|
1881 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1882 } |
|
1883 |
|
1884 /** |
|
1885 Gets the name of gps area tag value of the metadata. |
|
1886 |
|
1887 @param aParam |
|
1888 on return, the name of gps area value. |
|
1889 |
|
1890 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1891 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1892 |
|
1893 Note: According to the Exif 2.2 specification, the first 8 bytes of aParam should contain a Character Code to indicate the type of encoding used. See table 6 of the Exif 2.2 specification for a list of codes. |
|
1894 |
|
1895 @return error code |
|
1896 KErrArgument if the requested data type does not match with the tag. |
|
1897 KErrNotSupported if called on an encoding module. |
|
1898 KErrNotFound if the tag cannot be found. |
|
1899 KErrOverflow if there is an internal error with the Exif metadata. |
|
1900 */ |
|
1901 EXPORT_C TInt TExifReaderUtility::GetGpsAreaInformation(HBufC8*& aParam) const |
|
1902 { |
|
1903 if(iExifRead==NULL) |
|
1904 { |
|
1905 return KErrOverflow; |
|
1906 } |
|
1907 TInt tag = KTagGPS001C[ETagValue]; |
|
1908 |
|
1909 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1910 TUint ifd = KExifGpsIfd; |
|
1911 |
|
1912 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1913 } |
|
1914 |
|
1915 /** |
|
1916 Gets the gps date tag value of the metadata. |
|
1917 |
|
1918 @param aParam |
|
1919 on return, the gps date value. |
|
1920 |
|
1921 Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required. |
|
1922 Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership. |
|
1923 |
|
1924 @return error code |
|
1925 KErrArgument if the requested data type does not match with the tag. |
|
1926 KErrNotSupported if called on an encoding module. |
|
1927 KErrNotFound if the tag cannot be found. |
|
1928 KErrOverflow if there is an internal error with the Exif metadata. |
|
1929 */ |
|
1930 EXPORT_C TInt TExifReaderUtility::GetGpsDateStamp(HBufC8*& aParam) const |
|
1931 { |
|
1932 if(iExifRead==NULL) |
|
1933 { |
|
1934 return KErrOverflow; |
|
1935 } |
|
1936 TInt tag = KTagGPS001D[ETagValue]; |
|
1937 |
|
1938 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1939 TUint ifd = KExifGpsIfd; |
|
1940 |
|
1941 return iExifRead->GetParam8(tag, ifd, aParam); |
|
1942 } |
|
1943 |
|
1944 /** |
|
1945 Gets the gps differential correction tag value of the metadata. |
|
1946 |
|
1947 @param aParam |
|
1948 on return, the gps differential correction value. |
|
1949 |
|
1950 @return error code |
|
1951 KErrArgument if the requested data type does not match with the tag. |
|
1952 KErrNotSupported if called on an encoding module. |
|
1953 KErrNotFound if the tag cannot be found. |
|
1954 KErrOverflow if there is an internal error with the Exif metadata. |
|
1955 */ |
|
1956 EXPORT_C TInt TExifReaderUtility::GetGpsDifferential(TUint16& aParam) const |
|
1957 { |
|
1958 if(iExifRead==NULL) |
|
1959 { |
|
1960 return KErrOverflow; |
|
1961 } |
|
1962 TInt tag = KTagGPS001E[ETagValue]; |
|
1963 |
|
1964 // We need to specify GPS sub IFD using the upper 16 bits. |
|
1965 TUint ifd = KExifGpsIfd; |
|
1966 |
|
1967 return iExifRead->GetShortParam(tag, ifd, aParam); |
|
1968 } |
|
1969 |
|
1970 // Setters |
|
1971 |
|
1972 /** |
|
1973 Constructor |
|
1974 |
|
1975 instantiates the exif writer utility. |
|
1976 Note: no method on this utility should be used after the metadate has been destroyed |
|
1977 |
|
1978 @param aExifMetadata |
|
1979 the metadata class on which to read the tags |
|
1980 */ |
|
1981 EXPORT_C TExifWriterUtility::TExifWriterUtility(MExifMetadataWriter* aExifMetadata): |
|
1982 iExifWrite(aExifMetadata) |
|
1983 { |
|
1984 } |
|
1985 |
|
1986 /** |
|
1987 Sets the make tag value of the metadata. |
|
1988 |
|
1989 @param aMake |
|
1990 the make value |
|
1991 |
|
1992 @return error code |
|
1993 KErrArgument if the requested data type does not match with the tag. |
|
1994 KErrNotSupported if called on an encoding module. |
|
1995 KErrNotFound if the tag cannot be found. |
|
1996 */ |
|
1997 EXPORT_C TInt TExifWriterUtility::SetMake(HBufC8* aMake) |
|
1998 { |
|
1999 if(iExifWrite==NULL) |
|
2000 { |
|
2001 return KErrOverflow; |
|
2002 } |
|
2003 TInt tag = KTag010F[ETagValue]; |
|
2004 TInt ifd = KExifIfdZero; |
|
2005 return iExifWrite->SetParam8(tag, ifd, aMake); |
|
2006 } |
|
2007 |
|
2008 /** |
|
2009 Sets the model tag value of the metadata. |
|
2010 |
|
2011 @param aModel |
|
2012 the model value |
|
2013 |
|
2014 @return error code |
|
2015 KErrArgument if the requested data type does not match with the tag. |
|
2016 KErrNotSupported if called on an encoding module. |
|
2017 KErrNotFound if the tag cannot be found. |
|
2018 */ |
|
2019 EXPORT_C TInt TExifWriterUtility::SetModel(HBufC8* aModel) |
|
2020 { |
|
2021 if(iExifWrite==NULL) |
|
2022 { |
|
2023 return KErrOverflow; |
|
2024 } |
|
2025 TInt tag = KTag0110[ETagValue]; |
|
2026 TInt ifd = KExifIfdZero; |
|
2027 return iExifWrite->SetParam8(tag, ifd, aModel); |
|
2028 } |
|
2029 |
|
2030 /** |
|
2031 Sets the dateTime tag value of the metadata. |
|
2032 |
|
2033 @param aDateTime |
|
2034 the dateTime value |
|
2035 |
|
2036 @return error code |
|
2037 KErrArgument if the requested data type does not match with the tag. |
|
2038 KErrNotSupported if called on an encoding module. |
|
2039 KErrNotFound if the tag cannot be found. |
|
2040 */ |
|
2041 EXPORT_C TInt TExifWriterUtility::SetDateTime(HBufC8* aDateTime) |
|
2042 { |
|
2043 if(iExifWrite==NULL) |
|
2044 { |
|
2045 return KErrOverflow; |
|
2046 } |
|
2047 TInt tag = KTag0132[ETagValue]; |
|
2048 TInt ifd = KExifIfdZero; |
|
2049 return iExifWrite->SetParam8(tag, ifd, aDateTime); |
|
2050 } |
|
2051 |
|
2052 /** |
|
2053 Sets the dateTimeOriginal tag value of the metadata. |
|
2054 |
|
2055 @param aDateTime |
|
2056 the dateTimeOriginal value |
|
2057 |
|
2058 @return error code |
|
2059 KErrArgument if the requested data type does not match with the tag. |
|
2060 KErrNotSupported if called on an encoding module. |
|
2061 KErrNotFound if the tag cannot be found. |
|
2062 */ |
|
2063 EXPORT_C TInt TExifWriterUtility::SetDateTimeOriginal(HBufC8* aDateTime) |
|
2064 { |
|
2065 if(iExifWrite==NULL) |
|
2066 { |
|
2067 return KErrOverflow; |
|
2068 } |
|
2069 TInt tag = KTag9003[ETagValue]; |
|
2070 TInt ifd = KExifIfdZero; |
|
2071 return iExifWrite->SetParam8(tag, ifd, aDateTime); |
|
2072 } |
|
2073 |
|
2074 /** |
|
2075 Sets the dateTimeDigitized tag value of the metadata. |
|
2076 |
|
2077 @param aDateTime |
|
2078 the dateTimeDigitized value |
|
2079 |
|
2080 @return error code |
|
2081 KErrArgument if the requested data type does not match with the tag. |
|
2082 KErrNotSupported if called on an encoding module. |
|
2083 KErrNotFound if the tag cannot be found. |
|
2084 */ |
|
2085 EXPORT_C TInt TExifWriterUtility::SetDateTimeDigitized(HBufC8* aDateTime) |
|
2086 { |
|
2087 if(iExifWrite==NULL) |
|
2088 { |
|
2089 return KErrOverflow; |
|
2090 } |
|
2091 TInt tag = KTag9004[ETagValue]; |
|
2092 TInt ifd = KExifIfdZero; |
|
2093 return iExifWrite->SetParam8(tag, ifd, aDateTime); |
|
2094 } |
|
2095 |
|
2096 /** |
|
2097 Sets the interoperabilityindex tag value of the metadata. |
|
2098 |
|
2099 @param aIdx |
|
2100 the interoperabilityIndex value |
|
2101 |
|
2102 @return error code |
|
2103 KErrArgument if the requested data type does not match with the tag. |
|
2104 KErrNotSupported if called on an encoding module. |
|
2105 KErrNotFound if the tag cannot be found. |
|
2106 */ |
|
2107 EXPORT_C TInt TExifWriterUtility::SetInteroperabilityIndex(HBufC8* aIdx) |
|
2108 { |
|
2109 if(iExifWrite==NULL) |
|
2110 { |
|
2111 return KErrOverflow; |
|
2112 } |
|
2113 TInt tag = KTag0001[ETagValue]; |
|
2114 TInt ifd = KExifIfdZero; |
|
2115 return iExifWrite->SetParam8(tag, ifd, aIdx); |
|
2116 } |
|
2117 |
|
2118 /** |
|
2119 Sets the interoperabilityVersion tag value of the metadata. |
|
2120 |
|
2121 @param aIdx |
|
2122 the interoperabilityVersion value |
|
2123 |
|
2124 @return error code |
|
2125 KErrArgument if the requested data type does not match with the tag. |
|
2126 KErrNotSupported if called on an encoding module. |
|
2127 KErrNotFound if the tag cannot be found. |
|
2128 */ |
|
2129 EXPORT_C TInt TExifWriterUtility::SetInteroperabilityVersion(HBufC8* aIdx) |
|
2130 { |
|
2131 if(iExifWrite==NULL) |
|
2132 { |
|
2133 return KErrOverflow; |
|
2134 } |
|
2135 TInt tag = KTag0002[ETagValue]; |
|
2136 TInt ifd = KExifIfdZero; |
|
2137 return iExifWrite->SetParam8(tag, ifd, aIdx); |
|
2138 } |
|
2139 |
|
2140 /** |
|
2141 Sets the exifVersion tag value of the metadata. |
|
2142 |
|
2143 @param aExifVersion |
|
2144 the exifVersion value |
|
2145 |
|
2146 @return error code |
|
2147 KErrArgument if the requested data type does not match with the tag. |
|
2148 KErrNotSupported if called on an encoding module. |
|
2149 KErrNotFound if the tag cannot be found. |
|
2150 */ |
|
2151 EXPORT_C TInt TExifWriterUtility::SetExifVersion(HBufC8* aExifVersion) |
|
2152 { |
|
2153 if(iExifWrite==NULL) |
|
2154 { |
|
2155 return KErrOverflow; |
|
2156 } |
|
2157 TInt tag = KTag9000[ETagValue]; |
|
2158 TInt ifd = KExifIfdZero; |
|
2159 return iExifWrite->SetParam8(tag, ifd, aExifVersion); |
|
2160 } |
|
2161 |
|
2162 /** |
|
2163 Sets the componentsConfiguration tag value of the metadata. |
|
2164 |
|
2165 @param aComponentsConfig |
|
2166 the componentsConfiguration value |
|
2167 |
|
2168 @return error code |
|
2169 KErrArgument if the requested data type does not match with the tag. |
|
2170 KErrNotSupported if called on an encoding module. |
|
2171 KErrNotFound if the tag cannot be found. |
|
2172 */ |
|
2173 EXPORT_C TInt TExifWriterUtility::SetComponentsConfiguration(HBufC8* aComponentsConfig) |
|
2174 { |
|
2175 if(iExifWrite==NULL) |
|
2176 { |
|
2177 return KErrOverflow; |
|
2178 } |
|
2179 TInt tag = KTag9101[ETagValue]; |
|
2180 TInt ifd = KExifIfdZero; |
|
2181 return iExifWrite->SetParam8(tag, ifd, aComponentsConfig); |
|
2182 } |
|
2183 |
|
2184 /** |
|
2185 Sets the flashpixVersion tag value of the metadata. |
|
2186 |
|
2187 @param aFlashPixVer |
|
2188 the flashpixVersion value |
|
2189 |
|
2190 @return error code |
|
2191 KErrArgument if the requested data type does not match with the tag. |
|
2192 KErrNotSupported if called on an encoding module. |
|
2193 KErrNotFound if the tag cannot be found. |
|
2194 */ |
|
2195 EXPORT_C TInt TExifWriterUtility::SetFlashPixVersion(HBufC8* aFlashPixVer) |
|
2196 { |
|
2197 if(iExifWrite==NULL) |
|
2198 { |
|
2199 return KErrOverflow; |
|
2200 } |
|
2201 TInt tag = KTagA000[ETagValue]; |
|
2202 TInt ifd = KExifIfdZero; |
|
2203 return iExifWrite->SetParam8(tag, ifd, aFlashPixVer); |
|
2204 } |
|
2205 |
|
2206 /** |
|
2207 Sets the main image xResolution tag value of the metadata. |
|
2208 |
|
2209 @param aNumerator |
|
2210 the main image xResolution value numerator |
|
2211 @param aDenominator |
|
2212 the main image xResolution value denominator |
|
2213 |
|
2214 @return error code |
|
2215 KErrArgument if the requested data type does not match with the tag. |
|
2216 KErrNotSupported if called on an encoding module. |
|
2217 KErrNotFound if the tag cannot be found. |
|
2218 */ |
|
2219 EXPORT_C TInt TExifWriterUtility::SetXResolution(TInt aNumerator, TInt aDenominator) |
|
2220 { |
|
2221 if(iExifWrite==NULL) |
|
2222 { |
|
2223 return KErrOverflow; |
|
2224 } |
|
2225 TInt tag = KTag011A[ETagValue]; |
|
2226 TInt ifd = KExifIfdZero; |
|
2227 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2228 } |
|
2229 |
|
2230 /** |
|
2231 Sets the main image yResolution tag value of the metadata. |
|
2232 |
|
2233 @param aNumerator |
|
2234 the main image yResolution value numerator |
|
2235 @param aDenominator |
|
2236 the main image yResolution value denominator |
|
2237 |
|
2238 @return error code |
|
2239 KErrArgument if the requested data type does not match with the tag. |
|
2240 KErrNotSupported if called on an encoding module. |
|
2241 KErrNotFound if the tag cannot be found. |
|
2242 */ |
|
2243 EXPORT_C TInt TExifWriterUtility::SetYResolution(TInt aNumerator, TInt aDenominator) |
|
2244 { |
|
2245 if(iExifWrite==NULL) |
|
2246 { |
|
2247 return KErrOverflow; |
|
2248 } |
|
2249 TInt tag = KTag011B[ETagValue]; |
|
2250 TInt ifd = KExifIfdZero; |
|
2251 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2252 } |
|
2253 |
|
2254 /** |
|
2255 Sets the thumbnail xResolution tag value of the metadata. |
|
2256 |
|
2257 @param aNumerator |
|
2258 the thumbnail xResolution value numerator |
|
2259 @param aDenominator |
|
2260 the thumbnail xResolution value denominator |
|
2261 |
|
2262 @return error code |
|
2263 KErrArgument if the requested data type does not match with the tag. |
|
2264 KErrNotSupported if called on an encoding module. |
|
2265 KErrNotFound if the tag cannot be found. |
|
2266 */ |
|
2267 EXPORT_C TInt TExifWriterUtility::SetThumbXResolution(TInt aNumerator, TInt aDenominator) |
|
2268 { |
|
2269 if(iExifWrite==NULL) |
|
2270 { |
|
2271 return KErrOverflow; |
|
2272 } |
|
2273 TInt tag = KThumbTag011A[ETagValue]; |
|
2274 TInt ifd = KExifIfdOne; |
|
2275 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2276 } |
|
2277 |
|
2278 /** |
|
2279 Sets the thumbnail yResolution tag value of the metadata. |
|
2280 |
|
2281 @param aNumerator |
|
2282 the thumbnail yResolution value numerator |
|
2283 @param aDenominator |
|
2284 the thumbnail yResolution value denominator |
|
2285 |
|
2286 @return error code |
|
2287 KErrArgument if the requested data type does not match with the tag. |
|
2288 KErrNotSupported if called on an encoding module. |
|
2289 KErrNotFound if the tag cannot be found. |
|
2290 */ |
|
2291 EXPORT_C TInt TExifWriterUtility::SetThumbYResolution(TInt aNumerator, TInt aDenominator) |
|
2292 { |
|
2293 if(iExifWrite==NULL) |
|
2294 { |
|
2295 return KErrOverflow; |
|
2296 } |
|
2297 TInt tag = KThumbTag011B[ETagValue]; |
|
2298 TInt ifd = KExifIfdOne; |
|
2299 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2300 } |
|
2301 |
|
2302 /** |
|
2303 Sets the main image resolutionUnit tag value of the metadata. |
|
2304 |
|
2305 @param aResUnit |
|
2306 the main image resolutionUnit value |
|
2307 |
|
2308 Note: aResUnit may only take unsigned short (16-bit) values. |
|
2309 |
|
2310 @return error code |
|
2311 KErrArgument if the requested data type does not match with the tag. |
|
2312 KErrNotSupported if called on an encoding module. |
|
2313 KErrNotFound if the tag cannot be found. |
|
2314 */ |
|
2315 EXPORT_C TInt TExifWriterUtility::SetResolutionUnit(TInt aResUnit) |
|
2316 { |
|
2317 if(iExifWrite==NULL) |
|
2318 { |
|
2319 return KErrOverflow; |
|
2320 } |
|
2321 TInt tag = KTag0128[ETagValue]; |
|
2322 TInt ifd = KExifIfdZero; |
|
2323 return iExifWrite->SetShortParam(tag, ifd, aResUnit); |
|
2324 } |
|
2325 |
|
2326 /** |
|
2327 Sets the yCbCrPositioning tag value of the metadata. |
|
2328 |
|
2329 @param aPositioning |
|
2330 the yCbCrPositioning value |
|
2331 |
|
2332 Note: aPositioning may only take unsigned short (16-bit) values. |
|
2333 |
|
2334 @return error code |
|
2335 KErrArgument if the requested data type does not match with the tag. |
|
2336 KErrNotSupported if called on an encoding module. |
|
2337 KErrNotFound if the tag cannot be found. |
|
2338 */ |
|
2339 EXPORT_C TInt TExifWriterUtility::SetYCbCrPositioning(TInt aPositioning) |
|
2340 { |
|
2341 if(iExifWrite==NULL) |
|
2342 { |
|
2343 return KErrOverflow; |
|
2344 } |
|
2345 TInt tag = KTag0213[ETagValue]; |
|
2346 TInt ifd = KExifIfdZero; |
|
2347 return iExifWrite->SetShortParam(tag, ifd, aPositioning); |
|
2348 } |
|
2349 |
|
2350 /** |
|
2351 Sets the main image orientation tag value of the metadata. |
|
2352 |
|
2353 @param aOrientation |
|
2354 the main image orientation value |
|
2355 |
|
2356 Note: aOrientation may only take unsigned short (16-bit) values. |
|
2357 |
|
2358 @return error code |
|
2359 KErrArgument if the requested data type does not match with the tag. |
|
2360 KErrNotSupported if called on an encoding module. |
|
2361 KErrNotFound if the tag cannot be found. |
|
2362 */ |
|
2363 EXPORT_C TInt TExifWriterUtility::SetOrientation(TInt aOrientation) |
|
2364 { |
|
2365 if(iExifWrite==NULL) |
|
2366 { |
|
2367 return KErrOverflow; |
|
2368 } |
|
2369 TInt tag = KTag0112[ETagValue]; |
|
2370 TInt ifd = KExifIfdZero; |
|
2371 return iExifWrite->SetShortParam(tag, ifd, aOrientation); |
|
2372 } |
|
2373 |
|
2374 /** |
|
2375 Sets the colorSpace tag value of the metadata. |
|
2376 |
|
2377 @param aColorSpace |
|
2378 the colorSpace value |
|
2379 |
|
2380 Note: aColorSpace may only take unsigned short (16-bit) values. |
|
2381 |
|
2382 @return error code |
|
2383 KErrArgument if the requested data type does not match with the tag. |
|
2384 KErrNotSupported if called on an encoding module. |
|
2385 KErrNotFound if the tag cannot be found. |
|
2386 */ |
|
2387 EXPORT_C TInt TExifWriterUtility::SetColorSpace(TInt aColorSpace) |
|
2388 { |
|
2389 if(iExifWrite==NULL) |
|
2390 { |
|
2391 return KErrOverflow; |
|
2392 } |
|
2393 TInt tag = KTagA001[ETagValue]; |
|
2394 TInt ifd = KExifIfdZero; |
|
2395 return iExifWrite->SetShortParam(tag, ifd, aColorSpace); |
|
2396 } |
|
2397 |
|
2398 /** |
|
2399 Sets the pixelXDimension tag value of the metadata. |
|
2400 |
|
2401 @param aPixelXDim |
|
2402 the pixelXDimension value |
|
2403 |
|
2404 @return error code |
|
2405 KErrArgument if the requested data type does not match with the tag. |
|
2406 KErrNotSupported if called on an encoding module. |
|
2407 KErrNotFound if the tag cannot be found. |
|
2408 */ |
|
2409 EXPORT_C TInt TExifWriterUtility::SetPixelXDimension(TInt aPixelXDim) |
|
2410 { |
|
2411 if(iExifWrite==NULL) |
|
2412 { |
|
2413 return KErrOverflow; |
|
2414 } |
|
2415 TInt tag = KTagA002[ETagValue]; |
|
2416 TInt ifd = KExifIfdZero; |
|
2417 return iExifWrite->SetIntegerParam(tag, ifd, aPixelXDim); |
|
2418 } |
|
2419 |
|
2420 /** |
|
2421 Sets the pixelYDimension tag value of the metadata. |
|
2422 |
|
2423 @param aPixelYDim |
|
2424 the pixelYDimension value |
|
2425 |
|
2426 @return error code |
|
2427 KErrArgument if the requested data type does not match with the tag. |
|
2428 KErrNotSupported if called on an encoding module. |
|
2429 KErrNotFound if the tag cannot be found. |
|
2430 */ |
|
2431 EXPORT_C TInt TExifWriterUtility::SetPixelYDimension(TInt aPixelYDim) |
|
2432 { |
|
2433 if(iExifWrite==NULL) |
|
2434 { |
|
2435 return KErrOverflow; |
|
2436 } |
|
2437 TInt tag = KTagA003[ETagValue]; |
|
2438 TInt ifd = KExifIfdZero; |
|
2439 return iExifWrite->SetIntegerParam(tag, ifd, aPixelYDim); |
|
2440 } |
|
2441 |
|
2442 /** |
|
2443 Sets the thumbnail compression tag value of the metadata. |
|
2444 |
|
2445 @param aCompression |
|
2446 the thumbnail compression value |
|
2447 |
|
2448 Note: aCompression may only take unsigned short (16-bit) values. |
|
2449 |
|
2450 @return error code |
|
2451 KErrArgument if the requested data type does not match with the tag. |
|
2452 KErrNotSupported if called on an encoding module. |
|
2453 KErrNotFound if the tag cannot be found. |
|
2454 */ |
|
2455 EXPORT_C TInt TExifWriterUtility::SetThumbCompression(TInt aCompression) |
|
2456 { |
|
2457 if(iExifWrite==NULL) |
|
2458 { |
|
2459 return KErrOverflow; |
|
2460 } |
|
2461 TInt tag = KThumbTag0103[ETagValue]; |
|
2462 TInt ifd = KExifIfdOne; |
|
2463 return iExifWrite->SetShortParam(tag, ifd, aCompression); |
|
2464 } |
|
2465 |
|
2466 /** |
|
2467 Sets the thumbnail resolutionUnit tag value of the metadata. |
|
2468 |
|
2469 @param aResUnit |
|
2470 the thumbnail resolutionUnit value |
|
2471 |
|
2472 Note: aResUnit may only take unsigned short (16-bit) values. |
|
2473 |
|
2474 @return error code |
|
2475 KErrArgument if the requested data type does not match with the tag. |
|
2476 KErrNotSupported if called on an encoding module. |
|
2477 KErrNotFound if the tag cannot be found. |
|
2478 */ |
|
2479 EXPORT_C TInt TExifWriterUtility::SetThumbResolutionUnit(TInt aResUnit) |
|
2480 { |
|
2481 if(iExifWrite==NULL) |
|
2482 { |
|
2483 return KErrOverflow; |
|
2484 } |
|
2485 TInt tag = KThumbTag0128[ETagValue]; |
|
2486 TInt ifd = KExifIfdOne; |
|
2487 return iExifWrite->SetShortParam(tag, ifd, aResUnit); |
|
2488 } |
|
2489 |
|
2490 /** |
|
2491 Sets the thumbnail orientation tag value of the metadata. |
|
2492 |
|
2493 @param aOrientation |
|
2494 the thumbnail orientation value |
|
2495 |
|
2496 Note: aOrientation may only take unsigned short (16-bit) values. |
|
2497 |
|
2498 @return error code |
|
2499 KErrArgument if the requested data type does not match with the tag. |
|
2500 KErrNotSupported if called on an encoding module. |
|
2501 KErrNotFound if the tag cannot be found. |
|
2502 */ |
|
2503 EXPORT_C TInt TExifWriterUtility::SetThumbOrientation(TInt aOrientation) |
|
2504 { |
|
2505 if(iExifWrite==NULL) |
|
2506 { |
|
2507 return KErrOverflow; |
|
2508 } |
|
2509 TInt tag = KThumbTag0112[ETagValue]; |
|
2510 TInt ifd = KExifIfdOne; |
|
2511 return iExifWrite->SetShortParam(tag, ifd, aOrientation); |
|
2512 } |
|
2513 |
|
2514 /** |
|
2515 Sets the image description tag value of the metadata. |
|
2516 |
|
2517 @param aImageDescription |
|
2518 the image description value. |
|
2519 |
|
2520 @return error code |
|
2521 KErrArgument if the requested data type does not match with the tag. |
|
2522 KErrNotSupported if called on an encoding module. |
|
2523 KErrNotFound if the tag cannot be found. |
|
2524 KErrOverflow if there is an internal error with the Exif metadata. |
|
2525 */ |
|
2526 EXPORT_C TInt TExifWriterUtility::SetImageDescription(HBufC8* aImageDescription) |
|
2527 { |
|
2528 if(iExifWrite==NULL) |
|
2529 { |
|
2530 return KErrOverflow; |
|
2531 } |
|
2532 TInt tag = KTag010E[ETagValue]; |
|
2533 TInt ifd = KExifIfdZero; |
|
2534 return iExifWrite->SetParam8(tag, ifd, aImageDescription); |
|
2535 } |
|
2536 |
|
2537 /** |
|
2538 Sets the copyright tag value of the metadata. |
|
2539 |
|
2540 @param aCopyright |
|
2541 the copyright value. |
|
2542 |
|
2543 @return error code |
|
2544 KErrArgument if the requested data type does not match with the tag. |
|
2545 KErrNotSupported if called on an encoding module. |
|
2546 KErrNotFound if the tag cannot be found. |
|
2547 KErrOverflow if there is an internal error with the Exif metadata. |
|
2548 */ |
|
2549 EXPORT_C TInt TExifWriterUtility::SetCopyright(HBufC8* aCopyright) |
|
2550 { |
|
2551 if(iExifWrite==NULL) |
|
2552 { |
|
2553 return KErrOverflow; |
|
2554 } |
|
2555 TInt tag = KTag8298[ETagValue]; |
|
2556 TInt ifd = KExifIfdZero; |
|
2557 return iExifWrite->SetParam8(tag, ifd, aCopyright); |
|
2558 } |
|
2559 |
|
2560 /** |
|
2561 Sets the maker note tag value of the metadata. |
|
2562 |
|
2563 @param aMakerNote |
|
2564 the maker note value. |
|
2565 |
|
2566 @return error code |
|
2567 KErrArgument if the requested data type does not match with the tag. |
|
2568 KErrNotSupported if called on an encoding module. |
|
2569 KErrNotFound if the tag cannot be found. |
|
2570 KErrOverflow if there is an internal error with the Exif metadata. |
|
2571 */ |
|
2572 EXPORT_C TInt TExifWriterUtility::SetMakerNote(HBufC8* aMakerNote) |
|
2573 { |
|
2574 if(iExifWrite==NULL) |
|
2575 { |
|
2576 return KErrOverflow; |
|
2577 } |
|
2578 TInt tag = KTag927C[ETagValue]; |
|
2579 TInt ifd = KExifIfdZero; |
|
2580 return iExifWrite->SetParam8(tag, ifd, aMakerNote); |
|
2581 } |
|
2582 |
|
2583 /** |
|
2584 Sets the user comment tag value of the metadata. |
|
2585 |
|
2586 @param aUserComment |
|
2587 the user comment value. |
|
2588 |
|
2589 Note: According to the Exif 2.2 specification, the first 8 bytes of aUserComment must contain a Character Code to indicate the type of encoding used. See table 6 of the Exif 2.2 specification for a list of codes. |
|
2590 |
|
2591 @return error code |
|
2592 KErrArgument if the requested data type does not match with the tag. |
|
2593 KErrNotSupported if called on an encoding module. |
|
2594 KErrNotFound if the tag cannot be found. |
|
2595 KErrOverflow if there is an internal error with the Exif metadata. |
|
2596 */ |
|
2597 EXPORT_C TInt TExifWriterUtility::SetUserComment(HBufC8* aUserComment) |
|
2598 { |
|
2599 if(iExifWrite==NULL) |
|
2600 { |
|
2601 return KErrOverflow; |
|
2602 } |
|
2603 TInt tag = KTag9286[ETagValue]; |
|
2604 TInt ifd = KExifIfdZero; |
|
2605 return iExifWrite->SetParam8(tag, ifd, aUserComment); |
|
2606 } |
|
2607 |
|
2608 /** |
|
2609 Sets the flash tag value of the metadata. |
|
2610 |
|
2611 @param aFlash |
|
2612 the flash value. |
|
2613 |
|
2614 @return error code |
|
2615 KErrArgument if the requested data type does not match with the tag. |
|
2616 KErrNotSupported if called on an encoding module. |
|
2617 KErrNotFound if the tag cannot be found. |
|
2618 KErrOverflow if there is an internal error with the Exif metadata. |
|
2619 */ |
|
2620 EXPORT_C TInt TExifWriterUtility::SetFlash(TUint16 aFlash) |
|
2621 { |
|
2622 if(iExifWrite==NULL) |
|
2623 { |
|
2624 return KErrOverflow; |
|
2625 } |
|
2626 TInt tag = KTag9209[ETagValue]; |
|
2627 TInt ifd = KExifIfdZero; |
|
2628 return iExifWrite->SetShortParam(tag, ifd, aFlash); |
|
2629 } |
|
2630 |
|
2631 /** |
|
2632 Sets the focal length tag value of the metadata. |
|
2633 |
|
2634 @param aNumerator |
|
2635 the focal length numerator value |
|
2636 @param aDenominator |
|
2637 the focal length denominator value |
|
2638 |
|
2639 @return error code |
|
2640 KErrArgument if the requested data type does not match with the tag. |
|
2641 KErrNotSupported if called on an encoding module. |
|
2642 KErrNotFound if the tag cannot be found. |
|
2643 KErrOverflow if there is an internal error with the Exif metadata. |
|
2644 */ |
|
2645 EXPORT_C TInt TExifWriterUtility::SetFocalLength(TInt aNumerator, TInt aDenominator) |
|
2646 { |
|
2647 if(iExifWrite==NULL) |
|
2648 { |
|
2649 return KErrOverflow; |
|
2650 } |
|
2651 TInt tag = KTag920A[ETagValue]; |
|
2652 TInt ifd = KExifIfdZero; |
|
2653 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2654 } |
|
2655 |
|
2656 /** |
|
2657 Sets the shutter speed tag value of the metadata. |
|
2658 |
|
2659 @param aNumerator |
|
2660 the shutter speed numerator value. |
|
2661 |
|
2662 Note that aNumerator may take signed values. |
|
2663 |
|
2664 @param aDenominator |
|
2665 the shutter speed denominator value. |
|
2666 |
|
2667 Note that aDenominator may take signed values. |
|
2668 |
|
2669 @return error code |
|
2670 KErrArgument if the requested data type does not match with the tag. |
|
2671 KErrNotSupported if called on an encoding module. |
|
2672 KErrNotFound if the tag cannot be found. |
|
2673 KErrOverflow if there is an internal error with the Exif metadata. |
|
2674 */ |
|
2675 EXPORT_C TInt TExifWriterUtility::SetShutterSpeedValue(TInt aNumerator, TInt aDenominator) |
|
2676 { |
|
2677 if(iExifWrite==NULL) |
|
2678 { |
|
2679 return KErrOverflow; |
|
2680 } |
|
2681 TInt tag = KTag9201[ETagValue]; |
|
2682 TInt ifd = KExifIfdZero; |
|
2683 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2684 } |
|
2685 |
|
2686 /** |
|
2687 Sets the gps version id tag value of the metadata. |
|
2688 |
|
2689 @param aGpsVersionId |
|
2690 the gps version id value. |
|
2691 |
|
2692 @return error code |
|
2693 KErrArgument if the requested data type does not match with the tag. |
|
2694 KErrNotSupported if called on an encoding module. |
|
2695 KErrNotFound if the tag cannot be found. |
|
2696 KErrOverflow if there is an internal error with the Exif metadata. |
|
2697 */ |
|
2698 EXPORT_C TInt TExifWriterUtility::SetGpsVersionId(HBufC8* aGpsVersionId) |
|
2699 { |
|
2700 if(iExifWrite==NULL) |
|
2701 { |
|
2702 return KErrOverflow; |
|
2703 } |
|
2704 TInt tag = KTagGPS0000[ETagValue]; |
|
2705 |
|
2706 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2707 TUint ifd = KExifGpsIfd; |
|
2708 |
|
2709 return iExifWrite->SetParam8(tag, ifd, aGpsVersionId); |
|
2710 } |
|
2711 |
|
2712 /** |
|
2713 Sets the gps north or south latitude tag value of the metadata. |
|
2714 |
|
2715 @param aGpsLatitudeRef |
|
2716 the gps north or south latitude value. |
|
2717 |
|
2718 @return error code |
|
2719 KErrArgument if the requested data type does not match with the tag. |
|
2720 KErrNotSupported if called on an encoding module. |
|
2721 KErrNotFound if the tag cannot be found. |
|
2722 KErrOverflow if there is an internal error with the Exif metadata. |
|
2723 */ |
|
2724 EXPORT_C TInt TExifWriterUtility::SetGpsLatitudeRef(HBufC8* aGpsLatitudeRef) |
|
2725 { |
|
2726 if(iExifWrite==NULL) |
|
2727 { |
|
2728 return KErrOverflow; |
|
2729 } |
|
2730 TInt tag = KTagGPS0001[ETagValue]; |
|
2731 |
|
2732 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2733 TUint ifd = KExifGpsIfd; |
|
2734 |
|
2735 return iExifWrite->SetParam8(tag, ifd, aGpsLatitudeRef); |
|
2736 } |
|
2737 |
|
2738 |
|
2739 /** |
|
2740 Sets the gps latitude tag value of the metadata. |
|
2741 |
|
2742 @param aDegNumerator |
|
2743 the degrees latitude numerator value. |
|
2744 @param aDegDenominator |
|
2745 the degrees latitude denominator value. |
|
2746 @param aMinNumerator |
|
2747 the minutes latitude numerator value. |
|
2748 @param aMinDenominator |
|
2749 the minutes latitude denominator value. |
|
2750 @param aSecNumerator |
|
2751 the seconds latitude numerator value. |
|
2752 @param aSecDenominator |
|
2753 the seconds latitude denominator value. |
|
2754 |
|
2755 @return error code |
|
2756 KErrArgument if the requested data type does not match with the tag. |
|
2757 KErrNotSupported if called on an encoding module. |
|
2758 KErrNotFound if the tag cannot be found. |
|
2759 KErrOverflow if there is an internal error with the Exif metadata. |
|
2760 KErrNoMemory if there was not enough memory available to complete the request. |
|
2761 */ |
|
2762 EXPORT_C TInt TExifWriterUtility::SetGpsLatitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator) |
|
2763 { |
|
2764 if(iExifWrite==NULL) |
|
2765 { |
|
2766 return KErrOverflow; |
|
2767 } |
|
2768 TInt tag = KTagGPS0002[ETagValue]; |
|
2769 TInt count = KTagGPS0002[EComponentCountValue]; |
|
2770 |
|
2771 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2772 TUint ifd = KExifGpsIfd; |
|
2773 |
|
2774 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
2775 if (param == NULL) |
|
2776 { |
|
2777 return KErrNoMemory; |
|
2778 } |
|
2779 |
|
2780 const TRational degs={aDegNumerator, aDegDenominator}; |
|
2781 const TRational mins={aMinNumerator, aMinDenominator}; |
|
2782 const TRational secs={aSecNumerator, aSecDenominator}; |
|
2783 |
|
2784 TRAPD(insertErr, |
|
2785 param->InsertL(0, degs); |
|
2786 param->InsertL(1, mins); |
|
2787 param->InsertL(2, secs); ); |
|
2788 if (insertErr!=KErrNone) |
|
2789 { |
|
2790 delete param; |
|
2791 return insertErr; |
|
2792 } |
|
2793 |
|
2794 TInt result = iExifWrite->SetRationalArrayParam(tag, ifd, *param); |
|
2795 |
|
2796 delete param; |
|
2797 return result; |
|
2798 } |
|
2799 |
|
2800 /** |
|
2801 Sets the east or west longitude tag value of the metadata. |
|
2802 |
|
2803 @param aGpsLongitudeRef |
|
2804 the east or west longitude value. |
|
2805 |
|
2806 @return error code |
|
2807 KErrArgument if the requested data type does not match with the tag. |
|
2808 KErrNotSupported if called on an encoding module. |
|
2809 KErrNotFound if the tag cannot be found. |
|
2810 KErrOverflow if there is an internal error with the Exif metadata. |
|
2811 */ |
|
2812 EXPORT_C TInt TExifWriterUtility::SetGpsLongitudeRef(HBufC8* aGpsLongitudeRef) |
|
2813 { |
|
2814 if(iExifWrite==NULL) |
|
2815 { |
|
2816 return KErrOverflow; |
|
2817 } |
|
2818 TInt tag = KTagGPS0003[ETagValue]; |
|
2819 |
|
2820 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2821 TUint ifd = KExifGpsIfd; |
|
2822 |
|
2823 return iExifWrite->SetParam8(tag, ifd, aGpsLongitudeRef); |
|
2824 } |
|
2825 |
|
2826 /** |
|
2827 Sets the gps longitude tag value of the metadata. |
|
2828 |
|
2829 @param aDegNumerator |
|
2830 the degrees longitude numerator value. |
|
2831 @param aDegDenominator |
|
2832 the degrees longitude denominator value. |
|
2833 @param aMinNumerator |
|
2834 the minutes longitude numerator value. |
|
2835 @param aMinDenominator |
|
2836 the minutes longitude denominator value. |
|
2837 @param aSecNumerator |
|
2838 the seconds longitude numerator value. |
|
2839 @param aSecDenominator |
|
2840 the seconds longitude denominator value. |
|
2841 |
|
2842 @return error code |
|
2843 KErrArgument if the requested data type does not match with the tag. |
|
2844 KErrNotSupported if called on an encoding module. |
|
2845 KErrNotFound if the tag cannot be found. |
|
2846 KErrOverflow if there is an internal error with the Exif metadata. |
|
2847 KErrNoMemory if there was not enough memory available to complete the request. |
|
2848 */ |
|
2849 EXPORT_C TInt TExifWriterUtility::SetGpsLongitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator) |
|
2850 { |
|
2851 if(iExifWrite==NULL) |
|
2852 { |
|
2853 return KErrOverflow; |
|
2854 } |
|
2855 TInt tag = KTagGPS0004[ETagValue]; |
|
2856 TInt count = KTagGPS0004[EComponentCountValue]; |
|
2857 |
|
2858 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2859 TUint ifd = KExifGpsIfd; |
|
2860 |
|
2861 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
2862 if (param == NULL) |
|
2863 { |
|
2864 return KErrNoMemory; |
|
2865 } |
|
2866 |
|
2867 const TRational degs={aDegNumerator, aDegDenominator}; |
|
2868 const TRational mins={aMinNumerator, aMinDenominator}; |
|
2869 const TRational secs={aSecNumerator, aSecDenominator}; |
|
2870 |
|
2871 TRAPD(insertErr, |
|
2872 param->InsertL(0, degs); |
|
2873 param->InsertL(1, mins); |
|
2874 param->InsertL(2, secs); ); |
|
2875 if (insertErr!=KErrNone) |
|
2876 { |
|
2877 delete param; |
|
2878 return insertErr; |
|
2879 } |
|
2880 |
|
2881 TInt result = iExifWrite->SetRationalArrayParam(tag, ifd, *param); |
|
2882 |
|
2883 delete param; |
|
2884 return result; |
|
2885 } |
|
2886 |
|
2887 /** |
|
2888 Sets the gps altitude reference tag value of the metadata. |
|
2889 |
|
2890 @param aGpsAltitudeRef |
|
2891 the altitude reference value. |
|
2892 |
|
2893 @return error code |
|
2894 KErrArgument if the requested data type does not match with the tag. |
|
2895 KErrNotSupported if called on an encoding module. |
|
2896 KErrNotFound if the tag cannot be found. |
|
2897 KErrOverflow if there is an internal error with the Exif metadata. |
|
2898 KErrNoMemory if there was not enough memory available to complete the request. |
|
2899 */ |
|
2900 EXPORT_C TInt TExifWriterUtility::SetGpsAltitudeRef(TUint8 aGpsAltitudeRef) |
|
2901 { |
|
2902 if(iExifWrite==NULL) |
|
2903 { |
|
2904 return KErrOverflow; |
|
2905 } |
|
2906 TInt tag = KTagGPS0005[ETagValue]; |
|
2907 |
|
2908 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2909 TUint ifd = KExifGpsIfd; |
|
2910 |
|
2911 HBufC8* data = NULL; |
|
2912 TRAPD(err, data=HBufC8::NewL(1)); |
|
2913 if (err!=KErrNone) |
|
2914 { |
|
2915 return KErrNoMemory; |
|
2916 } |
|
2917 |
|
2918 TPtr8 bufPtr(data->Des()); |
|
2919 bufPtr.Append(aGpsAltitudeRef); |
|
2920 |
|
2921 TInt result = iExifWrite->SetParam8(tag, ifd, data); |
|
2922 delete data; |
|
2923 return result; |
|
2924 } |
|
2925 |
|
2926 /** |
|
2927 Sets the gps altitude tag value of the metadata. |
|
2928 |
|
2929 @param aNumerator |
|
2930 the altitude numerator value. |
|
2931 @param aDenominator |
|
2932 the altitude denominator value. |
|
2933 |
|
2934 @return error code |
|
2935 KErrArgument if the requested data type does not match with the tag. |
|
2936 KErrNotSupported if called on an encoding module. |
|
2937 KErrNotFound if the tag cannot be found. |
|
2938 KErrOverflow if there is an internal error with the Exif metadata. |
|
2939 */ |
|
2940 EXPORT_C TInt TExifWriterUtility::SetGpsAltitude(TInt aNumerator, TInt aDenominator) |
|
2941 { |
|
2942 if(iExifWrite==NULL) |
|
2943 { |
|
2944 return KErrOverflow; |
|
2945 } |
|
2946 TInt tag = KTagGPS0006[ETagValue]; |
|
2947 |
|
2948 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2949 TUint ifd = KExifGpsIfd; |
|
2950 |
|
2951 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
2952 } |
|
2953 |
|
2954 /** |
|
2955 Sets the gps time tag value of the metadata. |
|
2956 |
|
2957 @param aHourNumerator |
|
2958 the hour numerator value. |
|
2959 @param aHourDenominator |
|
2960 the hour denominator value. |
|
2961 @param aMinNumerator |
|
2962 the minutes numerator value. |
|
2963 @param aMinDenominator |
|
2964 the minutes denominator value. |
|
2965 @param aSecNumerator |
|
2966 the seconds numerator value. |
|
2967 @param aSecDenominator |
|
2968 the seconds denominator value. |
|
2969 |
|
2970 @return error code |
|
2971 KErrArgument if the requested data type does not match with the tag. |
|
2972 KErrNotSupported if called on an encoding module. |
|
2973 KErrNotFound if the tag cannot be found. |
|
2974 KErrOverflow if there is an internal error with the Exif metadata. |
|
2975 */ |
|
2976 EXPORT_C TInt TExifWriterUtility::SetGpsTimeStamp(TInt aHourNumerator, TInt aHourDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator) |
|
2977 { |
|
2978 if(iExifWrite==NULL) |
|
2979 { |
|
2980 return KErrOverflow; |
|
2981 } |
|
2982 TInt tag = KTagGPS0007[ETagValue]; |
|
2983 TInt count = KTagGPS0007[EComponentCountValue]; |
|
2984 |
|
2985 // We need to specify GPS sub IFD using the upper 16 bits. |
|
2986 TUint ifd = KExifGpsIfd; |
|
2987 |
|
2988 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
2989 if (param == NULL) |
|
2990 { |
|
2991 return KErrNoMemory; |
|
2992 } |
|
2993 |
|
2994 const TRational hours={aHourNumerator, aHourDenominator}; |
|
2995 const TRational mins={aMinNumerator, aMinDenominator}; |
|
2996 const TRational secs={aSecNumerator, aSecDenominator}; |
|
2997 |
|
2998 TRAPD(insertErr, |
|
2999 param->InsertL(0, hours); |
|
3000 param->InsertL(1, mins); |
|
3001 param->InsertL(2, secs); ); |
|
3002 if (insertErr!=KErrNone) |
|
3003 { |
|
3004 delete param; |
|
3005 return insertErr; |
|
3006 } |
|
3007 |
|
3008 TInt result = iExifWrite->SetRationalArrayParam(tag, ifd, *param); |
|
3009 |
|
3010 delete param; |
|
3011 return result; |
|
3012 } |
|
3013 |
|
3014 /** |
|
3015 Sets the gps satellites used for measurement tag value of the metadata. |
|
3016 |
|
3017 @param aGpsSatellites |
|
3018 the gps satellites used for measurement value. |
|
3019 |
|
3020 @return error code |
|
3021 KErrArgument if the requested data type does not match with the tag. |
|
3022 KErrNotSupported if called on an encoding module. |
|
3023 KErrNotFound if the tag cannot be found. |
|
3024 KErrOverflow if there is an internal error with the Exif metadata. |
|
3025 */ |
|
3026 EXPORT_C TInt TExifWriterUtility::SetGpsSatellites(HBufC8* aGpsSatellites) |
|
3027 { |
|
3028 if(iExifWrite==NULL) |
|
3029 { |
|
3030 return KErrOverflow; |
|
3031 } |
|
3032 TInt tag = KTagGPS0008[ETagValue]; |
|
3033 |
|
3034 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3035 TUint ifd = KExifGpsIfd; |
|
3036 |
|
3037 return iExifWrite->SetParam8(tag, ifd, aGpsSatellites); |
|
3038 } |
|
3039 |
|
3040 /** |
|
3041 Sets the gps receiver status tag value of the metadata. |
|
3042 |
|
3043 @param aGpsStatus |
|
3044 the gps receiver status value. |
|
3045 |
|
3046 @return error code |
|
3047 KErrArgument if the requested data type does not match with the tag. |
|
3048 KErrNotSupported if called on an encoding module. |
|
3049 KErrNotFound if the tag cannot be found. |
|
3050 KErrOverflow if there is an internal error with the Exif metadata. |
|
3051 */ |
|
3052 EXPORT_C TInt TExifWriterUtility::SetGpsStatus(HBufC8* aGpsStatus) |
|
3053 { |
|
3054 if(iExifWrite==NULL) |
|
3055 { |
|
3056 return KErrOverflow; |
|
3057 } |
|
3058 TInt tag = KTagGPS0009[ETagValue]; |
|
3059 |
|
3060 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3061 TUint ifd = KExifGpsIfd; |
|
3062 |
|
3063 return iExifWrite->SetParam8(tag, ifd, aGpsStatus); |
|
3064 } |
|
3065 |
|
3066 /** |
|
3067 Sets the gps measurement mode tag value of the metadata. |
|
3068 |
|
3069 @param aGpsMeasureMode |
|
3070 the gps measurement mode value. |
|
3071 |
|
3072 @return error code |
|
3073 KErrArgument if the requested data type does not match with the tag. |
|
3074 KErrNotSupported if called on an encoding module. |
|
3075 KErrNotFound if the tag cannot be found. |
|
3076 KErrOverflow if there is an internal error with the Exif metadata. |
|
3077 */ |
|
3078 EXPORT_C TInt TExifWriterUtility::SetGpsMeasureMode(HBufC8* aGpsMeasureMode) |
|
3079 { |
|
3080 if(iExifWrite==NULL) |
|
3081 { |
|
3082 return KErrOverflow; |
|
3083 } |
|
3084 TInt tag = KTagGPS000A[ETagValue]; |
|
3085 |
|
3086 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3087 TUint ifd = KExifGpsIfd; |
|
3088 |
|
3089 return iExifWrite->SetParam8(tag, ifd, aGpsMeasureMode); |
|
3090 } |
|
3091 |
|
3092 /** |
|
3093 Sets the gps measurement precision tag value of the metadata. |
|
3094 |
|
3095 @param aNumerator |
|
3096 the measurement precision numerator value. |
|
3097 @param aDenominator |
|
3098 the measurement precision denominator value. |
|
3099 |
|
3100 @return error code |
|
3101 KErrArgument if the requested data type does not match with the tag. |
|
3102 KErrNotSupported if called on an encoding module. |
|
3103 KErrNotFound if the tag cannot be found. |
|
3104 KErrOverflow if there is an internal error with the Exif metadata. |
|
3105 */ |
|
3106 EXPORT_C TInt TExifWriterUtility::SetGpsDop(TInt aNumerator, TInt aDenominator) |
|
3107 { |
|
3108 if(iExifWrite==NULL) |
|
3109 { |
|
3110 return KErrOverflow; |
|
3111 } |
|
3112 TInt tag = KTagGPS000B[ETagValue]; |
|
3113 |
|
3114 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3115 TUint ifd = KExifGpsIfd; |
|
3116 |
|
3117 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
3118 } |
|
3119 |
|
3120 /** |
|
3121 Sets the gps speed unit tag value of the metadata. |
|
3122 |
|
3123 @param aGpsSpeedRef |
|
3124 the speed unit value. |
|
3125 |
|
3126 @return error code |
|
3127 KErrArgument if the requested data type does not match with the tag. |
|
3128 KErrNotSupported if called on an encoding module. |
|
3129 KErrNotFound if the tag cannot be found. |
|
3130 KErrOverflow if there is an internal error with the Exif metadata. |
|
3131 */ |
|
3132 EXPORT_C TInt TExifWriterUtility::SetGpsSpeedRef(HBufC8* aGpsSpeedRef) |
|
3133 { |
|
3134 if(iExifWrite==NULL) |
|
3135 { |
|
3136 return KErrOverflow; |
|
3137 } |
|
3138 TInt tag = KTagGPS000C[ETagValue]; |
|
3139 |
|
3140 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3141 TUint ifd = KExifGpsIfd; |
|
3142 |
|
3143 return iExifWrite->SetParam8(tag, ifd, aGpsSpeedRef); |
|
3144 } |
|
3145 |
|
3146 /** |
|
3147 Sets the speed of gps receiver tag value of the metadata. |
|
3148 |
|
3149 @param aNumerator |
|
3150 the speed of gps receiver numerator value. |
|
3151 @param aDenominator |
|
3152 the speed of gps receiver denominator value. |
|
3153 |
|
3154 @return error code |
|
3155 KErrArgument if the requested data type does not match with the tag. |
|
3156 KErrNotSupported if called on an encoding module. |
|
3157 KErrNotFound if the tag cannot be found. |
|
3158 KErrOverflow if there is an internal error with the Exif metadata. |
|
3159 */ |
|
3160 EXPORT_C TInt TExifWriterUtility::SetGpsSpeed(TInt aNumerator, TInt aDenominator) |
|
3161 { |
|
3162 if(iExifWrite==NULL) |
|
3163 { |
|
3164 return KErrOverflow; |
|
3165 } |
|
3166 TInt tag = KTagGPS000D[ETagValue]; |
|
3167 |
|
3168 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3169 TUint ifd = KExifGpsIfd; |
|
3170 |
|
3171 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
3172 } |
|
3173 |
|
3174 /** |
|
3175 Sets the gps reference for direction of movement tag value of the metadata. |
|
3176 |
|
3177 @param aGpsTrackRef |
|
3178 the gps reference for direction of movement value. |
|
3179 |
|
3180 @return error code |
|
3181 KErrArgument if the requested data type does not match with the tag. |
|
3182 KErrNotSupported if called on an encoding module. |
|
3183 KErrNotFound if the tag cannot be found. |
|
3184 KErrOverflow if there is an internal error with the Exif metadata. |
|
3185 */ |
|
3186 EXPORT_C TInt TExifWriterUtility::SetGpsTrackRef(HBufC8* aGpsTrackRef) |
|
3187 { |
|
3188 if(iExifWrite==NULL) |
|
3189 { |
|
3190 return KErrOverflow; |
|
3191 } |
|
3192 TInt tag = KTagGPS000E[ETagValue]; |
|
3193 |
|
3194 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3195 TUint ifd = KExifGpsIfd; |
|
3196 |
|
3197 return iExifWrite->SetParam8(tag, ifd, aGpsTrackRef); |
|
3198 } |
|
3199 |
|
3200 /** |
|
3201 Sets the direction of movement tag value of the metadata. |
|
3202 |
|
3203 @param aNumerator |
|
3204 the direction of movement numerator value. |
|
3205 @param aDenominator |
|
3206 the direction of movement denominator value. |
|
3207 |
|
3208 @return error code |
|
3209 KErrArgument if the requested data type does not match with the tag. |
|
3210 KErrNotSupported if called on an encoding module. |
|
3211 KErrNotFound if the tag cannot be found. |
|
3212 KErrOverflow if there is an internal error with the Exif metadata. |
|
3213 */ |
|
3214 EXPORT_C TInt TExifWriterUtility::SetGpsTrack(TInt aNumerator, TInt aDenominator) |
|
3215 { |
|
3216 if(iExifWrite==NULL) |
|
3217 { |
|
3218 return KErrOverflow; |
|
3219 } |
|
3220 TInt tag = KTagGPS000F[ETagValue]; |
|
3221 |
|
3222 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3223 TUint ifd = KExifGpsIfd; |
|
3224 |
|
3225 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
3226 } |
|
3227 |
|
3228 /** |
|
3229 Sets the gps reference for direction of image tag value of the metadata. |
|
3230 |
|
3231 @param aGpsImgDirectionRef |
|
3232 the gps reference for direction of image value. |
|
3233 |
|
3234 @return error code |
|
3235 KErrArgument if the requested data type does not match with the tag. |
|
3236 KErrNotSupported if called on an encoding module. |
|
3237 KErrNotFound if the tag cannot be found. |
|
3238 KErrOverflow if there is an internal error with the Exif metadata. |
|
3239 */ |
|
3240 EXPORT_C TInt TExifWriterUtility::SetGpsImgDirectionRef(HBufC8* aGpsImgDirectionRef) |
|
3241 { |
|
3242 if(iExifWrite==NULL) |
|
3243 { |
|
3244 return KErrOverflow; |
|
3245 } |
|
3246 TInt tag = KTagGPS0010[ETagValue]; |
|
3247 |
|
3248 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3249 TUint ifd = KExifGpsIfd; |
|
3250 |
|
3251 return iExifWrite->SetParam8(tag, ifd, aGpsImgDirectionRef); |
|
3252 } |
|
3253 |
|
3254 /** |
|
3255 Sets the direction of image tag value of the metadata. |
|
3256 |
|
3257 @param aNumerator |
|
3258 the direction of image numerator value. |
|
3259 @param aDenominator |
|
3260 the direction of image denominator value. |
|
3261 |
|
3262 @return error code |
|
3263 KErrArgument if the requested data type does not match with the tag. |
|
3264 KErrNotSupported if called on an encoding module. |
|
3265 KErrNotFound if the tag cannot be found. |
|
3266 KErrOverflow if there is an internal error with the Exif metadata. |
|
3267 */ |
|
3268 EXPORT_C TInt TExifWriterUtility::SetGpsImgDirection(TInt aNumerator, TInt aDenominator) |
|
3269 { |
|
3270 if(iExifWrite==NULL) |
|
3271 { |
|
3272 return KErrOverflow; |
|
3273 } |
|
3274 TInt tag = KTagGPS0011[ETagValue]; |
|
3275 |
|
3276 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3277 TUint ifd = KExifGpsIfd; |
|
3278 |
|
3279 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
3280 } |
|
3281 |
|
3282 /** |
|
3283 Sets the gps geodetic survey data used tag value of the metadata. |
|
3284 |
|
3285 @param aGpsMapDatum |
|
3286 the geodetic survey data used value. |
|
3287 |
|
3288 @return error code |
|
3289 KErrArgument if the requested data type does not match with the tag. |
|
3290 KErrNotSupported if called on an encoding module. |
|
3291 KErrNotFound if the tag cannot be found. |
|
3292 KErrOverflow if there is an internal error with the Exif metadata. |
|
3293 */ |
|
3294 EXPORT_C TInt TExifWriterUtility::SetGpsMapDatum(HBufC8* aGpsMapDatum) |
|
3295 { |
|
3296 if(iExifWrite==NULL) |
|
3297 { |
|
3298 return KErrOverflow; |
|
3299 } |
|
3300 TInt tag = KTagGPS0012[ETagValue]; |
|
3301 |
|
3302 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3303 TUint ifd = KExifGpsIfd; |
|
3304 |
|
3305 return iExifWrite->SetParam8(tag, ifd, aGpsMapDatum); |
|
3306 } |
|
3307 |
|
3308 /** |
|
3309 Sets the gps reference for latitude of destination tag value of the metadata. |
|
3310 |
|
3311 @param aGpsDestLatitudeRef |
|
3312 the reference for latitude of destination value. |
|
3313 |
|
3314 @return error code |
|
3315 KErrArgument if the requested data type does not match with the tag. |
|
3316 KErrNotSupported if called on an encoding module. |
|
3317 KErrNotFound if the tag cannot be found. |
|
3318 KErrOverflow if there is an internal error with the Exif metadata. |
|
3319 */ |
|
3320 EXPORT_C TInt TExifWriterUtility::SetGpsDestLatitudeRef(HBufC8* aGpsDestLatitudeRef) |
|
3321 { |
|
3322 if(iExifWrite==NULL) |
|
3323 { |
|
3324 return KErrOverflow; |
|
3325 } |
|
3326 TInt tag = KTagGPS0013[ETagValue]; |
|
3327 |
|
3328 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3329 TUint ifd = KExifGpsIfd; |
|
3330 |
|
3331 return iExifWrite->SetParam8(tag, ifd, aGpsDestLatitudeRef); |
|
3332 } |
|
3333 |
|
3334 /** |
|
3335 Sets the gps latitude of destination tag value of the metadata. |
|
3336 |
|
3337 @param aDegNumerator |
|
3338 on return, the degrees latitude of destination numerator value |
|
3339 @param aDegDenominator |
|
3340 on return, the degrees latitude of destination denominator value |
|
3341 @param aMinNumerator |
|
3342 on return, the minutes latitude of destination numerator value |
|
3343 @param aMinDenominator |
|
3344 on return, the minutes latitude of destination denominator value |
|
3345 @param aSecNumerator |
|
3346 on return, the seconds latitude of destination numerator value |
|
3347 @param aSecDenominator |
|
3348 on return, the seconds latitude of destination denominator value |
|
3349 |
|
3350 @return error code |
|
3351 KErrArgument if the requested data type does not match with the tag. |
|
3352 KErrNotSupported if called on an encoding module. |
|
3353 KErrNotFound if the tag cannot be found. |
|
3354 KErrOverflow if there is an internal error with the Exif metadata. |
|
3355 */ |
|
3356 EXPORT_C TInt TExifWriterUtility::SetGpsDestLatitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator) |
|
3357 { |
|
3358 if(iExifWrite==NULL) |
|
3359 { |
|
3360 return KErrOverflow; |
|
3361 } |
|
3362 TInt tag = KTagGPS0014[ETagValue]; |
|
3363 TInt count = KTagGPS0014[EComponentCountValue]; |
|
3364 |
|
3365 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3366 TUint ifd = KExifGpsIfd; |
|
3367 |
|
3368 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
3369 if (param == NULL) |
|
3370 { |
|
3371 return KErrNoMemory; |
|
3372 } |
|
3373 |
|
3374 const TRational degs={aDegNumerator, aDegDenominator}; |
|
3375 const TRational mins={aMinNumerator, aMinDenominator}; |
|
3376 const TRational secs={aSecNumerator, aSecDenominator}; |
|
3377 |
|
3378 TRAPD(insertErr, |
|
3379 param->InsertL(0, degs); |
|
3380 param->InsertL(1, mins); |
|
3381 param->InsertL(2, secs); ); |
|
3382 if (insertErr!=KErrNone) |
|
3383 { |
|
3384 delete param; |
|
3385 return insertErr; |
|
3386 } |
|
3387 |
|
3388 TInt result = iExifWrite->SetRationalArrayParam(tag, ifd, *param); |
|
3389 |
|
3390 delete param; |
|
3391 return result; |
|
3392 } |
|
3393 |
|
3394 /** |
|
3395 Sets the gps reference for longitude of destination tag value of the metadata. |
|
3396 |
|
3397 @param aGpsDestLongitudeRef |
|
3398 the reference for longitude of destination value. |
|
3399 |
|
3400 @return error code |
|
3401 KErrArgument if the requested data type does not match with the tag. |
|
3402 KErrNotSupported if called on an encoding module. |
|
3403 KErrNotFound if the tag cannot be found. |
|
3404 KErrOverflow if there is an internal error with the Exif metadata. |
|
3405 */ |
|
3406 EXPORT_C TInt TExifWriterUtility::SetGpsDestLongitudeRef(HBufC8* aGpsDestLongitudeRef) |
|
3407 { |
|
3408 if(iExifWrite==NULL) |
|
3409 { |
|
3410 return KErrOverflow; |
|
3411 } |
|
3412 TInt tag = KTagGPS0015[ETagValue]; |
|
3413 |
|
3414 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3415 TUint ifd = KExifGpsIfd; |
|
3416 |
|
3417 return iExifWrite->SetParam8(tag, ifd, aGpsDestLongitudeRef); |
|
3418 } |
|
3419 |
|
3420 /** |
|
3421 Sets the gps longitude of destination tag value of the metadata. |
|
3422 |
|
3423 @param aDegNumerator |
|
3424 on return, the degrees longitude of destination numerator value |
|
3425 @param aDegDenominator |
|
3426 on return, the degrees longitude of destination denominator value |
|
3427 @param aMinNumerator |
|
3428 on return, the minutes longitude of destination numerator value |
|
3429 @param aMinDenominator |
|
3430 on return, the minutes longitude of destination denominator value |
|
3431 @param aSecNumerator |
|
3432 on return, the seconds longitude of destination numerator value |
|
3433 @param aSecDenominator |
|
3434 on return, the seconds longitude of destination denominator value |
|
3435 |
|
3436 @return error code |
|
3437 KErrArgument if the requested data type does not match with the tag. |
|
3438 KErrNotSupported if called on an encoding module. |
|
3439 KErrNotFound if the tag cannot be found. |
|
3440 KErrOverflow if there is an internal error with the Exif metadata. |
|
3441 */ |
|
3442 EXPORT_C TInt TExifWriterUtility::SetGpsDestLongitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator) |
|
3443 { |
|
3444 if(iExifWrite==NULL) |
|
3445 { |
|
3446 return KErrOverflow; |
|
3447 } |
|
3448 TInt tag = KTagGPS0016[ETagValue]; |
|
3449 TInt count = KTagGPS0016[EComponentCountValue]; |
|
3450 |
|
3451 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3452 TUint ifd = KExifGpsIfd; |
|
3453 |
|
3454 CArrayFixFlat<TRational>* param = new CArrayFixFlat<TRational>(count); |
|
3455 if (param == NULL) |
|
3456 { |
|
3457 return KErrNoMemory; |
|
3458 } |
|
3459 |
|
3460 const TRational degs={aDegNumerator, aDegDenominator}; |
|
3461 const TRational mins={aMinNumerator, aMinDenominator}; |
|
3462 const TRational secs={aSecNumerator, aSecDenominator}; |
|
3463 |
|
3464 TRAPD(insertErr, |
|
3465 param->InsertL(0, degs); |
|
3466 param->InsertL(1, mins); |
|
3467 param->InsertL(2, secs); ); |
|
3468 if (insertErr!=KErrNone) |
|
3469 { |
|
3470 delete param; |
|
3471 return insertErr; |
|
3472 } |
|
3473 |
|
3474 TInt result = iExifWrite->SetRationalArrayParam(tag, ifd, *param); |
|
3475 |
|
3476 delete param; |
|
3477 return result; |
|
3478 } |
|
3479 |
|
3480 /** |
|
3481 Sets the gps reference for bearing of destination tag value of the metadata. |
|
3482 |
|
3483 @param aGpsDestBearingRef |
|
3484 the reference for bearing of destination value. |
|
3485 |
|
3486 @return error code |
|
3487 KErrArgument if the requested data type does not match with the tag. |
|
3488 KErrNotSupported if called on an encoding module. |
|
3489 KErrNotFound if the tag cannot be found. |
|
3490 KErrOverflow if there is an internal error with the Exif metadata. |
|
3491 */ |
|
3492 EXPORT_C TInt TExifWriterUtility::SetGpsDestBearingRef(HBufC8* aGpsDestBearingRef) |
|
3493 { |
|
3494 if(iExifWrite==NULL) |
|
3495 { |
|
3496 return KErrOverflow; |
|
3497 } |
|
3498 TInt tag = KTagGPS0017[ETagValue]; |
|
3499 |
|
3500 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3501 TUint ifd = KExifGpsIfd; |
|
3502 |
|
3503 return iExifWrite->SetParam8(tag, ifd, aGpsDestBearingRef); |
|
3504 } |
|
3505 |
|
3506 /** |
|
3507 Sets the gps bearing of destination tag value of the metadata. |
|
3508 |
|
3509 @param aNumerator |
|
3510 the bearing of destination numerator value |
|
3511 @param aDenominator |
|
3512 the bearing of destination denominator value |
|
3513 |
|
3514 @return error code |
|
3515 KErrArgument if the requested data type does not match with the tag. |
|
3516 KErrNotSupported if called on an encoding module. |
|
3517 KErrNotFound if the tag cannot be found. |
|
3518 KErrOverflow if there is an internal error with the Exif metadata. |
|
3519 */ |
|
3520 EXPORT_C TInt TExifWriterUtility::SetGpsDestBearing(TInt aNumerator, TInt aDenominator) |
|
3521 { |
|
3522 if(iExifWrite==NULL) |
|
3523 { |
|
3524 return KErrOverflow; |
|
3525 } |
|
3526 TInt tag = KTagGPS0018[ETagValue]; |
|
3527 |
|
3528 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3529 TUint ifd = KExifGpsIfd; |
|
3530 |
|
3531 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
3532 } |
|
3533 |
|
3534 /** |
|
3535 Sets the gps reference for distance to destination tag value of the metadata. |
|
3536 |
|
3537 @param aGpsDestDistanceRef |
|
3538 the reference for distance to destination value. |
|
3539 |
|
3540 @return error code |
|
3541 KErrArgument if the requested data type does not match with the tag. |
|
3542 KErrNotSupported if called on an encoding module. |
|
3543 KErrNotFound if the tag cannot be found. |
|
3544 KErrOverflow if there is an internal error with the Exif metadata. |
|
3545 */ |
|
3546 EXPORT_C TInt TExifWriterUtility::SetGpsDestDistanceRef(HBufC8* aGpsDestDistanceRef) |
|
3547 { |
|
3548 if(iExifWrite==NULL) |
|
3549 { |
|
3550 return KErrOverflow; |
|
3551 } |
|
3552 TInt tag = KTagGPS0019[ETagValue]; |
|
3553 |
|
3554 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3555 TUint ifd = KExifGpsIfd; |
|
3556 |
|
3557 return iExifWrite->SetParam8(tag, ifd, aGpsDestDistanceRef); |
|
3558 } |
|
3559 |
|
3560 /** |
|
3561 Sets the gps distance to destination tag value of the metadata. |
|
3562 |
|
3563 @param aNumerator |
|
3564 the distance to destination numerator value. |
|
3565 @param aDenominator |
|
3566 the distance to destination denominator value. |
|
3567 |
|
3568 @return error code |
|
3569 KErrArgument if the requested data type does not match with the tag. |
|
3570 KErrNotSupported if called on an encoding module. |
|
3571 KErrNotFound if the tag cannot be found. |
|
3572 KErrOverflow if there is an internal error with the Exif metadata. |
|
3573 */ |
|
3574 EXPORT_C TInt TExifWriterUtility::SetGpsDestDistance(TInt aNumerator, TInt aDenominator) |
|
3575 { |
|
3576 if(iExifWrite==NULL) |
|
3577 { |
|
3578 return KErrOverflow; |
|
3579 } |
|
3580 TInt tag = KTagGPS001A[ETagValue]; |
|
3581 |
|
3582 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3583 TUint ifd = KExifGpsIfd; |
|
3584 |
|
3585 return iExifWrite->SetRationalParam(tag, ifd, aNumerator, aDenominator); |
|
3586 } |
|
3587 |
|
3588 /** |
|
3589 Sets the name of gps processing method tag value of the metadata. |
|
3590 |
|
3591 @param aGpsProcessingMethod |
|
3592 the name of gps processing method value. |
|
3593 |
|
3594 Note: According to the Exif 2.2 specification, the first 8 bytes of aGpsProcessingMethod must contain a Character Code to indicate the type of encoding used. See table 6 of the Exif 2.2 specification for a list of codes. |
|
3595 |
|
3596 @return error code |
|
3597 KErrArgument if the requested data type does not match with the tag. |
|
3598 KErrNotSupported if called on an encoding module. |
|
3599 KErrNotFound if the tag cannot be found. |
|
3600 KErrOverflow if there is an internal error with the Exif metadata. |
|
3601 */ |
|
3602 EXPORT_C TInt TExifWriterUtility::SetGpsProcessingMethod(HBufC8* aGpsProcessingMethod) |
|
3603 { |
|
3604 if(iExifWrite==NULL) |
|
3605 { |
|
3606 return KErrOverflow; |
|
3607 } |
|
3608 TInt tag = KTagGPS001B[ETagValue]; |
|
3609 |
|
3610 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3611 TUint ifd = KExifGpsIfd; |
|
3612 |
|
3613 return iExifWrite->SetParam8(tag, ifd, aGpsProcessingMethod); |
|
3614 } |
|
3615 |
|
3616 /** |
|
3617 Sets the name of gps area tag value of the metadata. |
|
3618 |
|
3619 @param aGpsAreaInformation |
|
3620 the name of gps area value. |
|
3621 |
|
3622 Note: According to the Exif 2.2 specification, the first 8 bytes of aGpsAreaInformation must contain a Character Code to indicate the type of encoding used. See table 6 of the Exif 2.2 specification for a list of codes. |
|
3623 |
|
3624 @return error code |
|
3625 KErrArgument if the requested data type does not match with the tag. |
|
3626 KErrNotSupported if called on an encoding module. |
|
3627 KErrNotFound if the tag cannot be found. |
|
3628 KErrOverflow if there is an internal error with the Exif metadata. |
|
3629 */ |
|
3630 EXPORT_C TInt TExifWriterUtility::SetGpsAreaInformation(HBufC8* aGpsAreaInformation) |
|
3631 { |
|
3632 if(iExifWrite==NULL) |
|
3633 { |
|
3634 return KErrOverflow; |
|
3635 } |
|
3636 TInt tag = KTagGPS001C[ETagValue]; |
|
3637 |
|
3638 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3639 TUint ifd = KExifGpsIfd; |
|
3640 |
|
3641 return iExifWrite->SetParam8(tag, ifd, aGpsAreaInformation); |
|
3642 } |
|
3643 |
|
3644 /** |
|
3645 Sets the gps date tag value of the metadata. |
|
3646 |
|
3647 @param aDateStamp |
|
3648 the gps date value. |
|
3649 |
|
3650 @return error code |
|
3651 KErrArgument if the requested data type does not match with the tag. |
|
3652 KErrNotSupported if called on an encoding module. |
|
3653 KErrNotFound if the tag cannot be found. |
|
3654 KErrOverflow if there is an internal error with the Exif metadata. |
|
3655 */ |
|
3656 EXPORT_C TInt TExifWriterUtility::SetGpsDateStamp(HBufC8* aDateStamp) |
|
3657 { |
|
3658 if(iExifWrite==NULL) |
|
3659 { |
|
3660 return KErrOverflow; |
|
3661 } |
|
3662 TInt tag = KTagGPS001D[ETagValue]; |
|
3663 |
|
3664 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3665 TUint ifd = KExifGpsIfd; |
|
3666 |
|
3667 return iExifWrite->SetParam8(tag, ifd, aDateStamp); |
|
3668 } |
|
3669 |
|
3670 /** |
|
3671 Sets the gps differential correction tag value of the metadata. |
|
3672 |
|
3673 @param aGpsDifferential |
|
3674 the gps differential correction value. |
|
3675 |
|
3676 @return error code |
|
3677 KErrArgument if the requested data type does not match with the tag. |
|
3678 KErrNotSupported if called on an encoding module. |
|
3679 KErrNotFound if the tag cannot be found. |
|
3680 KErrOverflow if there is an internal error with the Exif metadata. |
|
3681 */ |
|
3682 EXPORT_C TInt TExifWriterUtility::SetGpsDifferential(TUint16 aGpsDifferential) |
|
3683 { |
|
3684 if(iExifWrite==NULL) |
|
3685 { |
|
3686 return KErrOverflow; |
|
3687 } |
|
3688 TInt tag = KTagGPS001E[ETagValue]; |
|
3689 |
|
3690 // We need to specify GPS sub IFD using the upper 16 bits. |
|
3691 TUint ifd = KExifGpsIfd; |
|
3692 |
|
3693 return iExifWrite->SetShortParam(tag, ifd, aGpsDifferential); |
|
3694 } |
|
3695 |