commit faf71a2091dae01b8ec5c3f26ffb598e8eea11c2
parent e12a80e2dae2f4908a5bece6133a14041e9d3a77
Author: bsandro <[email protected]>
Date: Wed, 12 Jul 2023 22:57:46 +0300
Output filename is constructed with 'atlas_' prefix.
Diffstat:
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,2 +1,3 @@
emote2ss
+atlas_*.webp
*.o
diff --git a/Makefile b/Makefile
@@ -24,4 +24,4 @@ run: $(NAME)
test: $(NAME)
@./$(NAME) FlanClap.webp
- feh test01.webp
+ feh atlas_FlanClap.webp
diff --git a/src/main.c b/src/main.c
@@ -189,14 +189,20 @@ void write_webp(const char *fname, AnimatedImage *img, int cols, int rows) {
int main(int argc, const char **argv) {
atexit(print_webp_version);
+ char *outname = calloc(255, 1);
+ assert(outname!=NULL);
if (argc >= 1) {
for (int i=1; i<argc; ++i) {
AnimatedImage img = {0};
- assert(read_webp(argv[i], &img) == 0);
- printf("dimensions: %dx%d\nframes: %d\n", img.width, img.height, img.frame_count);
- write_webp("test01.webp", &img, 5, 4);
+ const char *inname = argv[i];
+ assert(read_webp(inname, &img) == 0);
+ int n = snprintf(outname, 254, "atlas_%s", inname);
+ assert(n>0);
+ printf("[%s -> %s]\ndimensions: %dx%d\nframes: %d\n", inname, outname, img.width, img.height, img.frame_count);
+ write_webp(outname, &img, 5, 4);
}
}
+ free(outname);
return 0;
}