File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -410,24 +410,24 @@ gpujpeg_image_get_file_format(const char* filename)
410410 { "XXX" , GPUJPEG_IMAGE_FILE_RAW },
411411 };
412412
413+ if ( strcmp (filename , "help" ) == 0 ) {
414+ PRINTF ("Recognized extensions:\n" );
415+ for ( unsigned i = 0 ; i < sizeof extensions / sizeof extensions [0 ]; i ++ ) {
416+ PRINTF ("\t- %s\n" , extensions [i ].ext );
417+ }
418+ PRINTF ("\nUse \"help.tst\" (eg. `gpujpegtool help.tst null.jpg`) for test image usage).\n" );
419+ return GPUJPEG_IMAGE_FILE_UNKNOWN ;
420+ }
421+
413422 const char * ext = strrchr (filename , '.' );
414423 if ( ext == NULL )
415424 return GPUJPEG_IMAGE_FILE_UNKNOWN ;
416425 ext ++ ;
417- if ( strcmp (ext , "help" ) == 0 ) {
418- PRINTF ("Recognized extensions:\n" );
419- }
420426 for ( unsigned i = 0 ; i < sizeof extensions / sizeof extensions [0 ]; i ++ ) {
421- if ( strcmp (ext , "help" ) == 0 ) {
422- PRINTF ("\t- %s\n" , extensions [i ].ext );
423- }
424427 if ( strcasecmp (ext , extensions [i ].ext ) == 0 ) {
425428 return extensions [i ].format ;
426429 }
427430 }
428- if ( strcmp (ext , "help" ) == 0 ) {
429- PRINTF ("\nUse \"help.tst\" (eg. `gpujpegtool help.tst null.jpg`) for test image usage).\n" );
430- }
431431 return GPUJPEG_IMAGE_FILE_UNKNOWN ;
432432}
433433
Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ main(int argc, char *argv[])
480480 }
481481
482482 if ( argv [0 ] != NULL && strcmp (argv [0 ], "exts" ) == 0 ) {
483- gpujpeg_image_get_file_format (". help" );
483+ gpujpeg_image_get_file_format ("help" );
484484 return 0 ;
485485 }
486486
You can’t perform that action at this time.
0 commit comments