Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Side by Side Diff: webkit/fileapi/media/picasa/pmp_constants.h

Issue 12704024: Simple PMP reader to parse Picasa's metadata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More formatting/ style changes. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_CONSTANTS_H_
6 #define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_CONSTANTS_H_
7
8 #include "base/basictypes.h"
9
10 namespace fileapi {
11
12 // PMP file format.
13 // Info derived from: http://sbktech.blogspot.com/2011/12/picasa-pmp-format.html
14
15 // values look "flipped" because serialized as little-endian
16
17 // Total header size: 4+2+2+4+2+2+4 = 20 bytes
18 const size_t kPmpHeaderSize = 20;
19
20 // [0] - 4 Bytes - cd cc cc 3f
21 const uint8 kPmpMagicO0S4[] = { 0xcd, 0xcc, 0xcc, 0x3f };
vandebo (ex-Chrome) 2013/03/27 00:06:19 The 00S4 nomenclature isn't like anything else I'v
tommycli 2013/03/27 19:34:30 Cool that's way better.
22
23 // [4] - 2 Bytes - Field type
24 const int kPmpFieldTypeFirstOffset = 4;
25
26 // [6] - 2 Bytes - 32 13
27 const uint8 kPmpMagicO6S2[] = { 0x32, 0x13 };
28
29 // [8] - 4 Bytes - 02 00 00 00
30 const uint8 kPmpMagicO8S4[] = { 0x02, 0x00, 0x00, 0x00 };
31
32 // [12] - 2 bytes - Field type. Same as above.
33 const int kPmpFieldTypeSecondOffset = 12;
34
35 // [14] - 2 bytes - 32 13
36 const uint8 kPmpMagicO14S2[] = { 0x32, 0x13 };
37
38 // [16] - 4 bytes - Row count as uint32.
39 const int kPmpRowCountOffset = 16;
40
41 // [20] - * bytes - Rest of the entries.
42
43 // Field types:
44 // 0x00 - cstrings
vandebo (ex-Chrome) 2013/03/27 00:06:19 Comments below aren't necessary, the code describe
tommycli 2013/03/27 19:34:30 Done.
45 const uint16 kPmpFieldTypeString = 0x00;
46
47 // 0x01 - uint32
48 const uint16 kPmpFieldTypeUInt32 = 0x01;
49
50 // 0x02 - double (Microsoft variant time)
51 const uint16 kPmpFieldTypeDouble64 = 0x02;
52
53 // 0x03 - uint8
54 const uint16 kPmpFieldTypeUInt8 = 0x03;
55
56 // 0x04 - uint64
57 const uint16 kPmpFieldTypeUInt64 = 0x04;
58
59 // 0x05 - uint16 - unhandled
60 // const uint16 kPmpFieldTypeUInt16 = 0x05;
61
62 // 0x06 - cstrings - unhandled
63 // const uint16 kPmpFieldTypeString_06 = 0x06;
64
65 // 0x07 - uint32 - unhandled
66 // const uint16 kPmpFieldTypeUInt32_07 = 0x07;
67
68 } // namespace fileapi
69
70 #endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_CONSTANTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698