Skip to content

Commit f1d2d40

Browse files
committed
fix build with libheif save buit not load
We had some definitions inside the #ifdef HEIFLOAD. Thanks estepnv #1844
1 parent 678b6d5 commit f1d2d40

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- improve seek behaviour on pipes
1515
- add "speed" param to heifsave [lovell]
1616
- fix regression in C path for dilate / erode [kleisauke]
17+
- fix build with libheif save but no load [estepnv]
1718

1819
9/8/20 started 8.10.1
1920
- fix markdown -> xml conversion in doc generation

libvips/foreign/heifload.c

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,33 @@
6868
#include <vips/debug.h>
6969
#include <vips/internal.h>
7070

71-
#ifdef HAVE_HEIF_DECODER
71+
/* These are shared with the encoder.
72+
*/
73+
#if defined(HAVE_HEIF_DECODER) || defined(HAVE_HEIF_ENCODER)
7274

7375
#include <libheif/heif.h>
7476

7577
#include "pforeign.h"
7678

79+
void
80+
vips__heif_error( struct heif_error *error )
81+
{
82+
if( error->code )
83+
vips_error( "heif", "%s (%d.%d)", error->message, error->code,
84+
error->subcode );
85+
}
86+
87+
const char *vips__heif_suffs[] = {
88+
".heic",
89+
".heif",
90+
".avif",
91+
NULL
92+
};
93+
94+
#endif /*defined(DECODE) || defined(ENCODE)*/
95+
96+
#ifdef HAVE_HEIF_DECODER
97+
7798
#define VIPS_TYPE_FOREIGN_LOAD_HEIF (vips_foreign_load_heif_get_type())
7899
#define VIPS_FOREIGN_LOAD_HEIF( obj ) \
79100
(G_TYPE_CHECK_INSTANCE_CAST( (obj), \
@@ -200,14 +221,6 @@ vips_foreign_load_heif_dispose( GObject *gobject )
200221
dispose( gobject );
201222
}
202223

203-
void
204-
vips__heif_error( struct heif_error *error )
205-
{
206-
if( error->code )
207-
vips_error( "heif", "%s (%d.%d)", error->message, error->code,
208-
error->subcode );
209-
}
210-
211224
static int
212225
vips_foreign_load_heif_build( VipsObject *object )
213226
{
@@ -1055,13 +1068,6 @@ vips_foreign_load_heif_file_is_a( const char *filename )
10551068
return( vips_foreign_load_heif_is_a( buf, 12 ) );
10561069
}
10571070

1058-
const char *vips__heif_suffs[] = {
1059-
".heic",
1060-
".heif",
1061-
".avif",
1062-
NULL
1063-
};
1064-
10651071
static void
10661072
vips_foreign_load_heif_file_class_init( VipsForeignLoadHeifFileClass *class )
10671073
{

0 commit comments

Comments
 (0)