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

Side by Side Diff: tools/imgconv.cpp

Issue 1760583003: Remove unused tools and unused includes of SkImageDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « tools/find_bad_images_in_skps.py ('k') | tools/json/SkJSONCanvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkBitmap.h"
9 #include "SkGraphics.h"
10 #include "SkImageDecoder.h"
11 #include "SkImageEncoder.h"
12 #include "SkString.h"
13
14 int tool_main(int argc, char** argv);
15 int tool_main(int argc, char** argv) {
16 SkAutoGraphics ag;
17
18 for (int i = 1; i < argc; ++i) {
19 SkString src(argv[i]);
20 if (src.endsWith(".png")) {
21 SkString dst(src.c_str(), src.size() - 4);
22 dst.append(".jpg");
23
24 SkBitmap bm;
25 if (SkImageDecoder::DecodeFile(src.c_str(), &bm)) {
26 if (SkImageEncoder::EncodeFile(dst.c_str(), bm, SkImageEncoder:: kJPEG_Type, 100)) {
27 SkDebugf("converted %s to %s\n", src.c_str(), dst.c_str());
28 } else {
29 SkDebugf("failed to encode %s\n", src.c_str());
30 }
31 } else {
32 SkDebugf("failed to decode %s\n", src.c_str());
33 }
34 }
35 }
36 return 0;
37 }
38
39 #if !defined SK_BUILD_FOR_IOS
40 int main(int argc, char * const argv[]) {
41 return tool_main(argc, (char**) argv);
42 }
43 #endif
OLDNEW
« no previous file with comments | « tools/find_bad_images_in_skps.py ('k') | tools/json/SkJSONCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698