@@ -58,7 +58,6 @@ static void*
5858gpujpeg_cuda_realloc_sized_host (void * ptr , int oldsz , int newsz );
5959#define STBI_NO_JPEG
6060#define STBI_NO_PSD
61- #define STBI_NO_GIF
6261#define STBI_NO_HDR
6362#define STBI_NO_PIC
6463#define STBI_NO_PNM
@@ -448,6 +447,10 @@ stbi_save_delegate(const char* filename, const struct gpujpeg_image_parameters*
448447 if ( strcasecmp (ext , "bmp" ) == 0 ) {
449448 write .func = stbi_write_bmp ;
450449 }
450+ else if ( strcasecmp (ext , "gif" ) == 0 ) {
451+ ERROR_MSG ("[stbi] Only gif decoder is present, the encoder is not supported!\n" );
452+ return -1 ;
453+ }
451454 else if ( strcasecmp (ext , "png" ) == 0 ) {
452455 write .func_stridden = stbi_write_png ;
453456 stride_bytes = param_image -> width * comp_count ;
@@ -501,6 +504,10 @@ stbi_image_probe_delegate(const char* filename, enum gpujpeg_image_file_format f
501504 param_image -> color_space = GPUJPEG_RGB ;
502505 param_image -> pixel_format = GPUJPEG_444_U8_P012 ;
503506 }
507+ else if ( comp == 4 ) {
508+ param_image -> color_space = GPUJPEG_RGB ;
509+ param_image -> pixel_format = GPUJPEG_4444_U8_P0123 ;
510+ }
504511 else {
505512 ERROR_MSG ("[stbi] Unsupported channel count %d for %s\n" , comp , filename );
506513 return -1 ;
@@ -577,6 +584,7 @@ tst_image_load_delegate(const char* filename, size_t* image_size, void** image_d
577584image_load_delegate_t gpujpeg_get_image_load_delegate (enum gpujpeg_image_file_format format ) {
578585 switch (format ) {
579586 case GPUJPEG_IMAGE_FILE_BMP :
587+ case GPUJPEG_IMAGE_FILE_GIF :
580588 case GPUJPEG_IMAGE_FILE_PNG :
581589 case GPUJPEG_IMAGE_FILE_TGA :
582590 return stbi_load_delegate ;
@@ -607,6 +615,7 @@ image_probe_delegate_t gpujpeg_get_image_probe_delegate(enum gpujpeg_image_file_
607615{
608616 switch (format ) {
609617 case GPUJPEG_IMAGE_FILE_BMP :
618+ case GPUJPEG_IMAGE_FILE_GIF :
610619 case GPUJPEG_IMAGE_FILE_PNG :
611620 case GPUJPEG_IMAGE_FILE_TGA :
612621 return stbi_image_probe_delegate ;
@@ -637,6 +646,7 @@ image_save_delegate_t gpujpeg_get_image_save_delegate(enum gpujpeg_image_file_fo
637646{
638647 switch (format ) {
639648 case GPUJPEG_IMAGE_FILE_BMP :
649+ case GPUJPEG_IMAGE_FILE_GIF :
640650 case GPUJPEG_IMAGE_FILE_PNG :
641651 case GPUJPEG_IMAGE_FILE_TGA :
642652 return stbi_save_delegate ;
0 commit comments