Commit bc736c08 for libheif

commit bc736c084f07d46713b596dad8fa9f201771ba35
Author: Dirk Farin <dirk.farin@gmail.com>
Date:   Sun May 17 15:13:07 2026 +0200

    remove heif_image_handle_has_omaf_image_projection()

diff --git a/examples/heif_info.cc b/examples/heif_info.cc
index 1dd43107..b54a1de9 100644
--- a/examples/heif_info.cc
+++ b/examples/heif_info.cc
@@ -949,8 +949,8 @@ int main(int argc, char** argv)
 #if HEIF_WITH_OMAF
     // --- OMAF

-    if (heif_image_handle_has_omaf_image_projection(handle)) {
-      heif_omaf_image_projection projection = heif_image_handle_get_omaf_image_projection(handle);
+    heif_omaf_image_projection projection = heif_image_handle_get_omaf_image_projection(handle);
+    if (projection != heif_omaf_image_projection_flat) {
       std::cout << "  image projection: ";
       switch (projection)
       {
diff --git a/libheif/api/libheif/heif_image.h b/libheif/api/libheif/heif_image.h
index 665303fa..3cdfac14 100644
--- a/libheif/api/libheif/heif_image.h
+++ b/libheif/api/libheif/heif_image.h
@@ -161,7 +161,11 @@ typedef enum heif_omaf_image_projection
   heif_omaf_image_projection_unknown = 0xFE,

   /**
-   * Flat projection, assumed if no projection information provided.
+   * Flat projection. Also returned by the get-projection accessors when no
+   * projection information is present on the image, so callers can use
+   * `result == heif_omaf_image_projection_flat` to test for "no prfr box".
+   * 0xFF lies outside the prfr value range reserved by ISO 23090-2:2023
+   * Table 10, so it cannot collide with a value read from a file.
    */
   heif_omaf_image_projection_flat = 0xFF,
 } heif_omaf_image_projection;
diff --git a/libheif/api/libheif/heif_properties.cc b/libheif/api/libheif/heif_properties.cc
index 4e809956..4ed65065 100644
--- a/libheif/api/libheif/heif_properties.cc
+++ b/libheif/api/libheif/heif_properties.cc
@@ -458,19 +458,6 @@ heif_error heif_camera_extrinsic_matrix_get_rotation_matrix(const heif_camera_ex
   return heif_error_success;
 }

-int heif_image_handle_has_omaf_image_projection(const heif_image_handle* handle)
-{
-  if (!handle) {
-    return false;
-  }
-
-#if HEIF_WITH_OMAF
-  return handle->image->has_omaf_image_projection();
-#else
-  return false;
-#endif
-}
-
 heif_omaf_image_projection heif_image_handle_get_omaf_image_projection(const heif_image_handle* handle)
 {
 #if HEIF_WITH_OMAF
diff --git a/libheif/api/libheif/heif_properties.h b/libheif/api/libheif/heif_properties.h
index ca33a7b1..aafa7a9e 100644
--- a/libheif/api/libheif/heif_properties.h
+++ b/libheif/api/libheif/heif_properties.h
@@ -230,12 +230,10 @@ heif_error heif_camera_extrinsic_matrix_get_rotation_matrix(const heif_camera_ex

 // ------------------------- OMAF projection information -------------------------
 // These accessors are always present in the API. When libheif was built without
-// OMAF support, the query functions report "no projection" (0 /
-// heif_omaf_image_projection_flat) and the setter returns
-// heif_error_Unsupported_feature.
-LIBHEIF_API
-int heif_image_handle_has_omaf_image_projection(const heif_image_handle* handle);
-
+// OMAF support, the getter reports "no projection" (heif_omaf_image_projection_flat)
+// and the setter returns heif_error_Unsupported_feature.
+// To test whether projection information is present, compare the getter's result
+// against heif_omaf_image_projection_flat.
 LIBHEIF_API
 heif_omaf_image_projection heif_image_handle_get_omaf_image_projection(const heif_image_handle* handle);