@@ -1336,11 +1336,6 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
1336
1336
MagickBooleanType
1337
1337
lossless = image_info -> quality >= 100 ? MagickTrue : MagickFalse ;
1338
1338
1339
- #if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION (1 ,17 ,0 )
1340
- struct heif_color_profile_nclx
1341
- nclx_profile ;
1342
- #endif
1343
-
1344
1339
struct heif_encoding_options
1345
1340
* options ;
1346
1341
@@ -1405,24 +1400,26 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
1405
1400
GeometryInfo
1406
1401
cicp ;
1407
1402
1408
- /*
1409
- Set BT.709 primaries, sRGB transfer, @ full range.
1410
- */
1403
+ struct heif_color_profile_nclx
1404
+ * nclx_profile ;
1405
+
1411
1406
SetGeometryInfo (& cicp );
1412
- cicp .rho = 1 ;
1413
- cicp .sigma = 13 ;
1414
- cicp .xi = 6 ;
1415
- cicp .psi = 1 ;
1407
+ nclx_profile = heif_nclx_color_profile_alloc ();
1408
+ cicp .rho = (double ) nclx_profile -> color_primaries ;
1409
+ cicp .sigma = (double ) nclx_profile -> transfer_characteristics ;
1410
+ cicp .xi = (double ) nclx_profile -> matrix_coefficients ;
1411
+ cicp .psi = (double ) nclx_profile -> full_range_flag ;
1416
1412
(void ) ParseGeometry (option ,& cicp );
1417
1413
memset (& nclx_profile ,0 ,sizeof (nclx_profile ));
1418
- heif_nclx_color_profile_set_color_primaries (& nclx_profile ,
1414
+ heif_nclx_color_profile_set_color_primaries (nclx_profile ,
1419
1415
(uint16_t ) cicp .rho );
1420
- heif_nclx_color_profile_set_transfer_characteristics (& nclx_profile ,
1416
+ heif_nclx_color_profile_set_transfer_characteristics (nclx_profile ,
1421
1417
(uint16_t ) cicp .sigma );
1422
- heif_nclx_color_profile_set_matrix_coefficients (& nclx_profile ,
1418
+ heif_nclx_color_profile_set_matrix_coefficients (nclx_profile ,
1423
1419
(uint16_t ) cicp .xi );
1424
- nclx_profile .full_range_flag = (uint16_t ) cicp .psi ;
1425
- heif_image_set_nclx_color_profile (heif_image ,& nclx_profile );
1420
+ nclx_profile -> full_range_flag = (uint16_t ) cicp .psi ;
1421
+ heif_image_set_nclx_color_profile (heif_image ,nclx_profile );
1422
+ heif_nclx_color_profile_free (nclx_profile );
1426
1423
}
1427
1424
#endif
1428
1425
profile = GetImageProfile (image ,"icc" );
0 commit comments