Commit cf80c7a3 for libheif
commit cf80c7a36bb0673d921f9a674c1c510d0dd1dc97
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Sun Dec 21 20:37:55 2025 +0100
add test case for #1641
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 04680385..d8fdfd8b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -60,6 +60,7 @@ add_libheif_test(extended_type)
add_libheif_test(region)
add_libheif_test(tai)
add_libheif_test(text)
+add_libheif_test(cxx_wrapper)
if (WITH_OPENJPH_ENCODER AND SUPPORTS_J2K_HT_ENCODING)
add_libheif_test(encode_htj2k)
diff --git a/tests/cxx_wrapper.cc b/tests/cxx_wrapper.cc
new file mode 100644
index 00000000..e217ea36
--- /dev/null
+++ b/tests/cxx_wrapper.cc
@@ -0,0 +1,42 @@
+/*
+ libheif unit tests
+
+ MIT License
+
+ Copyright (c) 2025 Dirk Farin <dirk.farin@gmail.com>
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+#include "catch_amalgamated.hpp"
+#include "test_utils.h"
+#include <libheif/heif_cxx.h>
+#include <iostream>
+
+TEST_CASE( "C++ object copy (ColorProfile_nclx)" )
+{
+ // This is the reproducer from issue #1641
+
+ heif::Image img;
+
+ img.create(16,16, heif_colorspace_RGB, heif_chroma_interleaved_RGBA);
+
+ heif::ColorProfile_nclx a = img.get_nclx_color_profile();
+ heif::ColorProfile_nclx b(a);
+}
\ No newline at end of file