diff --git a/.gitignore b/.gitignore index 7594bd685e489f54ec694d32a85c81ed8ef53399..f8dd62488f2d4fd31f2db8ec690a494446b049ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .DS_Store -*.png blpconvert +samples/*.png +samples/*.bmp +samples/*.jpg +samples/*.tga diff --git a/README.md b/README.md index 62226cec28ef30b8ce210cc8acf449644a4e8e9a..2321049815cb2a308a8958cd35a90b12954537bd 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Fullname: samples/Ability_Ambush.blp Folder: samples Filename: Ability_Ambush Extension: .blp + Format: png BLP File Details: Type: 1, BLP/DXTC/Uncompressed Compression: 2, DXTC diff --git a/main.c b/main.c index ab81be04aafde73a838c8ccaa051ad099d991c66..1b6369cf5a4f949fe3d70ea383dad59cf5afbe2d 100644 --- a/main.c +++ b/main.c @@ -54,12 +54,12 @@ image_format get_format_type(const char *format) { if (strcasecmp(format, "png") == 0) return PNG; if (strcasecmp(format, "bmp") == 0) return BMP; if (strcasecmp(format, "tga") == 0) return TGA; - if (strcasecmp(format, "jpg") == 0 || strcasecmp(format, "jpeg") == 0) return JPG; + if (strcasecmp(format, "jpg") == 0) return JPG; return PNG; } bool is_valid_format(const char *format) { - const char *valid_formats[] = {"png", "bmp", "tga", "jpg", "jpeg", NULL}; + const char *valid_formats[] = {"png", "bmp", "tga", "jpg", NULL}; for (const char **f = valid_formats; *f != NULL; f++) { if (strcasecmp(format, *f) == 0) { return true; @@ -304,7 +304,7 @@ printf("Successfully saved %s\n", output_filename); } break; case JPG: - if (verbose) printf("Processing as JPEG format\n"); + if (verbose) printf("Processing as JPG format\n"); if (stbi_write_jpg(output_filename, width, height, 4, decoded_image, 100) == 0) { printf("Failed to write %s file\n", output_filename); } else { @@ -425,7 +425,7 @@ printf("Options:\n"); printf(" -h, --help Display this help message\n"); printf(" -v, --verbose Enable verbose output\n"); printf(" -f, --format=FORMAT Set output format (default: png)\n"); - printf(" Options: png, bmp, tga, jpg, jpeg\n"); + printf(" Options: png, bmp, tga, jpg\n"); } int main(int argc, char *argv[]) { @@ -455,7 +455,7 @@ verbose = true; break; case 'f': if (!is_valid_format(optarg)) { - fprintf(stderr, "Error: Invalid format '%s'. Valid formats are: png, bmp, tga, jpg, jpeg\n", optarg); + fprintf(stderr, "Error: Invalid format '%s'. Valid formats are: png, bmp, tga, jpg\n", optarg); return 1; } format = optarg;