summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlexandre Erwin Ittner <alexandre@ittner.com.br>2014-09-21 10:25:46 -0300
committerAlexandre Erwin Ittner <alexandre@ittner.com.br>2014-09-21 10:25:46 -0300
commit70b4018069c0bbfa7ac2cf907a76a693e78e2947 (patch)
tree109e053dfc4a9003ba6f08406ba9512df9affcfd /docs
parente4f66475d8b47ee3b289fdd75bbbce3230949eed (diff)
Remove support for avatar image formats other than PNG
Support for other formats was deemed unnecessary in the code review and therefore removed. The value for the constant TOX_AVATARFORMAT_PNG is now set in stone; if the other formats become needed again in the future, this commit shall be reverted and the enum values reordered to keep compatibility.
Diffstat (limited to 'docs')
-rw-r--r--docs/Avatars.md44
1 files changed, 20 insertions, 24 deletions
diff --git a/docs/Avatars.md b/docs/Avatars.md
index bd4046d4..f0d7a1eb 100644
--- a/docs/Avatars.md
+++ b/docs/Avatars.md
@@ -88,9 +88,9 @@ in Section "Internal Protocol Description".
88 88
89 This event contain two data fields: (1) the image format and (2) the 89 This event contain two data fields: (1) the image format and (2) the
90 cryptographic hash of the actual image data. Image format may be NONE 90 cryptographic hash of the actual image data. Image format may be NONE
91 (for users who have no avatar or removed their avatars), JPEG, PNG, or 91 (for users who have no avatar or removed their avatars) or PNG. The
92 GIF. The cryptographic hash is intended to be compared with the hash o 92 cryptographic hash is intended to be compared with the hash o the
93 the currently cached avatar (if any) and check if it stills up to date. 93 currently cached avatar (if any) and check if it stills up to date.
94 94
95 - **Avatar Information Requests** are very lightweight messages sent by an 95 - **Avatar Information Requests** are very lightweight messages sent by an
96 user asking for an **avatar information notification**. They may be sent 96 user asking for an **avatar information notification**. They may be sent
@@ -134,9 +134,7 @@ complete API documentation is available in `tox.h`.
134/* Data formats for user avatar images */ 134/* Data formats for user avatar images */
135typedef enum { 135typedef enum {
136 TOX_AVATARFORMAT_NONE, 136 TOX_AVATARFORMAT_NONE,
137 TOX_AVATARFORMAT_JPEG, 137 TOX_AVATARFORMAT_PNG
138 TOX_AVATARFORMAT_PNG,
139 TOX_AVATARFORMAT_GIF
140} 138}
141TOX_AVATARFORMAT; 139TOX_AVATARFORMAT;
142 140
@@ -243,18 +241,18 @@ already downloaded by other clients can be reused.
243 241
244Given the Tox data directory described in STS Draft v0.1.0: 242Given the Tox data directory described in STS Draft v0.1.0:
245 243
246 - The user avatar is stored in a file named "avatar.ext", where "ext" is 244 - The user avatar is stored in a file named "avatar.png". As more formats
247 "jpg", "png", or "gif", according to the image format. Clients should 245 may be used in the future, another extensions are reserved and clients
248 keep just one of these files, with the data of the last avatar set by 246 should keep just one file named "avatar.*", with the data of the last
249 the user. If the user have no avatar, no such files should be kept in 247 avatar set by the user. If the user have no avatar, no such files should
250 the data directory; 248 be kept in the data directory;
251 249
252 - Friends avatars are stored in a directory called "avatars" and named 250 - Friends avatars are stored in a directory called "avatars" and named
253 as "xxxxx.ext", where "xxxxx" is the complete client id encoded as an 251 as "xxxxx.png", where "xxxxx" is the complete client id encoded as an
254 uppercase hexadecimal string and "ext" is "jpg", "png", or "gif", 252 uppercase hexadecimal string and "png" is the extension for the PNG
255 according to the image format. Clients should keep just one of these 253 avatar. As new image formats may be used in the future, clients should
256 files per friend, with the data received from the last avatar data 254 ensure no other file "xxxxx.*" exists. No file should be kept for an user
257 notification. No file should be kept for an user who have no avatar. 255 who have no avatar.
258 256
259 **To be discussed:** User keys are usually presented in Tox clients as 257 **To be discussed:** User keys are usually presented in Tox clients as
260 upper case strings, but lower case file names are more usual. 258 upper case strings, but lower case file names are more usual.
@@ -264,13 +262,13 @@ Example for Linux and other Unix systems, assuming an user called "gildor":
264 262
265 Tox data directory: /home/gildor/.config/tox/ 263 Tox data directory: /home/gildor/.config/tox/
266 Tox data file: /home/gildor/.config/tox/data 264 Tox data file: /home/gildor/.config/tox/data
267 Gildor's avatar: /home/gildor/.config/tox/avatar.jpg 265 Gildor's avatar: /home/gildor/.config/tox/avatar.png
268 Avatar data dir: /home/gildor/.config/tox/avatars/ 266 Avatar data dir: /home/gildor/.config/tox/avatars/
269 Elrond's avatar: /home/gildor/.config/tox/avatars/43656C65627269616E20646F6E277420546F782E426164206D656D6F72696573.jpg 267 Elrond's avatar: /home/gildor/.config/tox/avatars/43656C65627269616E20646F6E277420546F782E426164206D656D6F72696573.png
270 Elladan's avatar: /home/gildor/.config/tox/avatars/49486174655768656E48756D616E735468696E6B49416D4D7942726F74686572.gif 268 Elladan's avatar: /home/gildor/.config/tox/avatars/49486174655768656E48756D616E735468696E6B49416D4D7942726F74686572.png
271 Elrohir's avatar /home/gildor/.config/tox/avatars/726568746F7242794D6D41496B6E696854736E616D75486E6568576574614849.jpg 269 Elrohir's avatar /home/gildor/.config/tox/avatars/726568746F7242794D6D41496B6E696854736E616D75486E6568576574614849.png
272 Arwen's avatar: /home/gildor/.config/tox/avatars/53686520746F6F6B20476C6F7266696E64656C277320706C6163652068657265.png 270 Arwen's avatar: /home/gildor/.config/tox/avatars/53686520746F6F6B20476C6F7266696E64656C277320706C6163652068657265.png
273 Lindir's avatar: /home/gildor/.config/tox/avatars/417070735772697474656E42794D6F7274616C734C6F6F6B54686553616D652E.gif 271 Lindir's avatar: /home/gildor/.config/tox/avatars/417070735772697474656E42794D6F7274616C734C6F6F6B54686553616D652E.png
274 272
275This recommendation is partially implemented by "testing/test_avatars.c". 273This recommendation is partially implemented by "testing/test_avatars.c".
276 274
@@ -456,9 +454,7 @@ the following structure:
456Where 'format' is the image data format, one of the following: 454Where 'format' is the image data format, one of the following:
457 455
458 0 = AVATARFORMAT_NONE (no avatar set) 456 0 = AVATARFORMAT_NONE (no avatar set)
459 1 = AVATARFORMAT_JPEG 457 1 = AVATARFORMAT_PNG
460 2 = AVATARFORMAT_PNG
461 3 = AVATARFORMAT_GIF
462 458
463and 'hash' is the SHA-256 message digest of the avatar data. 459and 'hash' is the SHA-256 message digest of the avatar data.
464 460