diff options
author | mtklein <mtklein@chromium.org> | 2015-09-10 10:37:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-10 10:37:44 -0700 |
commit | d69ece6a03d497cead8dc5c5ea2d682e49800df4 (patch) | |
tree | 2031e325bece491b256e0cea52336763f749e6b4 | |
parent | a82bf954ef3831117f1c268cec5dd655c6dc019b (diff) |
DM: add --key and --properties to PNG description field.
This tags each image with the bot that created it.
BUG=skia:4322
Review URL: https://codereview.chromium.org/1332903002
-rw-r--r-- | dm/DM.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -674,12 +674,23 @@ static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) { return false; } + SkString description; + description.append("Key: "); + for (int i = 0; i < FLAGS_key.count(); i++) { + description.appendf("%s ", FLAGS_key[i]); + } + description.append("Properties: "); + for (int i = 0; i < FLAGS_properties.count(); i++) { + description.appendf("%s ", FLAGS_properties[i]); + } + description.appendf("MD5: %s", md5); + png_text text[2]; text[0].key = (png_charp)"Author"; text[0].text = (png_charp)"DM dump_png()"; text[0].compression = PNG_TEXT_COMPRESSION_NONE; text[1].key = (png_charp)"Description"; - text[1].text = (png_charp)md5; + text[1].text = (png_charp)description.c_str(); text[1].compression = PNG_TEXT_COMPRESSION_NONE; png_set_text(png, info, text, 2); |