diff --git a/Makefile b/Makefile index 1f0a66507..847051df7 100644 --- a/Makefile +++ b/Makefile @@ -152,7 +152,7 @@ $(EMOJI_DIR)/%.png: $(EMOJI_SRC_DIR)/%.png | $(EMOJI_DIR) @convert -extent 136x128 -gravity center -background none "$<" "$@" $(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag $(PNGQUANT) | $(FLAGS_DIR) - @./waveflag "$<" "$@" + @./waveflag $(FLAGS_DIR)/ "$<" $(RESIZED_FLAGS_DIR)/%.png: $(FLAGS_DIR)/%.png | $(RESIZED_FLAGS_DIR) @convert -extent 136x128 -gravity center -background none "$<" "$@" diff --git a/waveflag.c b/waveflag.c index 8e0cb07b3..6a9459a24 100644 --- a/waveflag.c +++ b/waveflag.c @@ -17,6 +17,7 @@ */ #include +#include // basename #include #include #include @@ -269,7 +270,7 @@ wave_flag (const char *filename, const char *out_prefix) cairo_surface_t *scaled_flag, *waved_flag; cairo_t *cr; - printf ("Processing %s\n", filename); + if (debug) printf ("Processing %s\n", filename); scaled_flag = load_scaled_flag (filename, &aspect); @@ -277,7 +278,7 @@ wave_flag (const char *filename, const char *out_prefix) aspect = sqrt (aspect); // Discount the effect if (.9 <= aspect && aspect <= 1.1) { - printf ("Standard aspect ratio\n"); + if (debug) printf ("Standard aspect ratio\n"); aspect = 1.; } @@ -335,7 +336,7 @@ wave_flag (const char *filename, const char *out_prefix) } else { - printf ("Transparent border\n"); + if (debug) printf ("Transparent border\n"); cairo_new_path (cr); } @@ -410,7 +411,7 @@ wave_flag (const char *filename, const char *out_prefix) *out = '\0'; strcat (out, out_prefix); - strcat (out, filename); + strcat (out, basename(filename)); cairo_surface_write_to_png (cairo_get_target (cr), out); cairo_destroy (cr);