Skip to content

Commit

Permalink
Wrap png_get_color_type for Fpng
Browse files Browse the repository at this point in the history
Prior to this change the "without PNG" build path does not successfully
build under Meson.

Signed-off-by: Matt Jolly <[email protected]>
  • Loading branch information
Kangie committed Sep 17, 2024
1 parent 676e465 commit d1f2cff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion libs/Fpng.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ typedef Fpng_struct **Fpng_structpp;
#define Fpng_destroy_read_struct(a,b,c) png_destroy_read_struct(a,b,c)
#define Fpng_init_io(a,b) png_init_io(a,b)
#define Fpng_read_info(a,b) png_read_info(a,b)
#define Fpng_get_color_type(a, b) png_get_color_type(a, b)
#define Fpng_get_IHDR(a,b,c,d,e,f,g,h,i) png_get_IHDR(a,b,c,d,e,f,g,h,i)
#define Fpng_set_expand(a) png_set_expand(a)
#define Fpng_set_swap_alpha(a) png_set_swap_alpha(a)
Expand Down Expand Up @@ -471,9 +472,10 @@ typedef Fpng_struct **Fpng_structpp;
#define FPNG_INFO_tRNS 7

#define Fpng_check_sig(a,b) 0
#define Fpng_create_read_struct(a,b,c,d) NULL
#define Fpng_create_info_struct(a) NULL
#define Fpng_create_read_struct(a,b,c,d) NULL
#define Fpng_destroy_read_struct(a,b,c)
#define Fpng_get_color_type(a, b) 0
#define Fpng_init_io(a,b)
#define Fpng_read_info(a,b)
#define Fpng_get_IHDR(a,b,c,d,e,f,g,h,i)
Expand Down
6 changes: 3 additions & 3 deletions libs/PictureImageLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,16 @@ Bool PImageLoadPng(FIMAGE_CMD_ARGS)
* this fail to build on much older libpng versions which we support
* (pre 1.3), then I might have to.
*/
if (png_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_RGB_ALPHA)
if (Fpng_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_RGB_ALPHA)
{
hasa = 1;
}
if (png_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_GRAY_ALPHA)
if (Fpng_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_GRAY_ALPHA)
{
hasa = 1;
hasg = 1;
}
if (png_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_GRAY)
if (Fpng_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_GRAY)
{
hasg = 1;
}
Expand Down

0 comments on commit d1f2cff

Please sign in to comment.