nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgcodecs/test/test_gif.cpp
**Change Type:** added
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -0,0 +1,357 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#include "test_precomp.hpp"
+
+#ifdef HAVE_IMGCODEC_GIF
+
+namespace opencv_test { namespace {
+
```

Review comment:
here the testing data is converted from the testing images under `pngsuite` in extra via ffmpeg, thus we directly reference to the xmls that the png test uses. would this solution be fine?
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** added
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -0,0 +1,1144 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level
+// directory of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+#include "grfmt_gif.hpp"
+
+#ifdef HAVE_IMGCODEC_GIF
+namespace cv
```

Review comment:
why do you need a try/catch here?
**File:** modules/imgcodecs/src/grfmt_gif.hpp
**Change Type:** added
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -0,0 +1,183 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level
+// directory of this distribution and at http://opencv.org/license.html
+
+#ifndef OPENCV_GRFMT_GIF_HPP
+#define OPENCV_GRFMT_GIF_HPP
+#ifdef HAVE_IMGCODEC_GIF
+
+#include "grfmt_base.hpp"
```

Review comment:
No need to make that struct public
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** added
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -0,0 +1,1144 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level
+// directory of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+#include "grfmt_gif.hpp"
+
+#ifdef HAVE_IMGCODEC_GIF
+namespace cv
```

Review comment:
at first i think i need to deal with some potential memory leak, as using vector and autobuffer this is not needed but i forgot to delete it. in the newest version i deleted it.
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** added
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -0,0 +1,1144 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level
+// directory of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+#include "grfmt_gif.hpp"
+
+#ifdef HAVE_IMGCODEC_GIF
+namespace cv
```

Review comment:
```cpp std::vector<Mat> img_vec(1, img); ``` to avoid push_back overhead
**File:** modules/imgcodecs/src/grfmt_gif.cpp
**Change Type:** added
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -0,0 +1,1144 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level
+// directory of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+#include "grfmt_gif.hpp"
+
+#ifdef HAVE_IMGCODEC_GIF
+namespace cv
```

Review comment:
```cpp std::vector<Mat> img_vec(1, img); ```
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #25691: [GSoC] Add GIF decode and encode for imgcodecs

**Code Changes:**
```diff
@@ -464,6 +464,9 @@ OCV_OPTION(WITH_ITT "Include Intel ITT support" ON
 OCV_OPTION(WITH_PROTOBUF "Enable libprotobuf" ON
   VISIBLE_IF TRUE
   VERIFY HAVE_PROTOBUF)
+OCV_OPTION(WITH_IMGCODEC_GIF "Include GIF support" OFF
+  VISIBLE_IF TRUE
+  VERIFY HAVE_IMGCODEC_GIF)
 OCV_OPTION(WITH_IMGCODEC_HDR "Include HDR support" ON
   VISIBLE_IF TRUE
   VERIFY HAVE_IMGCODEC_HDR)
```

Review comment:
I believe we should disable it by default at least for now to allow users test it in safe environment and our OSS-Fuzz builds.
**File:** modules/dnn/src/onnx/onnx_graph_simplifier.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -10,6 +10,8 @@
 #ifdef HAVE_PROTOBUF
 #include "../graph_simplifier.hpp"
 #include "onnx_graph_simplifier.hpp"
+#include <opencv2/core/utils/filesystem.hpp>
+#include "opencv2/core/utils/filesystem.private.hpp"
 
 #include <opencv2/core/utils/logger.hpp>
 #include <queue>
@@ -1704,30 +1706,82 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
```

Review comment:
I'd suggest to modify this function (and probably rename it) to return `Mat` instead of plain pointer. This way we can track memory allocations properly. Currently, I suspect, there are memory leaks.
**File:** modules/dnn/src/onnx/onnx_importer2.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -7,7 +7,7 @@
 
 #include <opencv2/dnn/shape_utils.hpp>
 #include <opencv2/dnn/layer_reg.private.hpp>
-
+#include <opencv2/core/utils/filesystem.hpp>
 #include <opencv2/core/utils/fp_control_utils.hpp>
 #include <opencv2/core/utils/logger.defines.hpp>
 #undef CV_LOG_STRIP_LEVEL
@@ -58,7 +58,9 @@ static T getScalarFromMat(Mat m)
```

Review comment:
can probably just remove the unused function instead of commenting it off; if we need it later, we can restore it from the git history.
**File:** modules/dnn/src/onnx/onnx_importer2.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import
**Review Line:** 106

**Code Changes:**
```diff
@@ -100,9 +103,9 @@ static std::string dataType2str(opencv_onnx::TensorProto_DataType dt)
     return std::string(str);
 }
 
-static Mat getMatFromTensor2(const opencv_onnx::TensorProto& tensor_proto)
+static Mat getMatFromTensor2(const opencv_onnx::TensorProto& tensor_proto, const std::string base_path="")
 {
-    Mat m = getMatFromTensor(tensor_proto, false);
+    Mat m = getMatFromTensor(tensor_proto, false, base_path);
     m.dims = (int)tensor_proto.dims_size();
     return m;
```

Review comment:
`const std::string&`
**File:** modules/dnn/src/onnx/onnx_graph_simplifier.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -10,6 +10,8 @@
 #ifdef HAVE_PROTOBUF
 #include "../graph_simplifier.hpp"
 #include "onnx_graph_simplifier.hpp"
+#include <opencv2/core/utils/filesystem.hpp>
+#include "opencv2/core/utils/filesystem.private.hpp"
 
 #include <opencv2/core/utils/logger.hpp>
 #include <queue>
@@ -1704,30 +1706,82 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
```

Review comment:
There are platforms, where filesystem is not available. You need to handle it like here: https://github.com/opencv/opencv/blob/d1b4b46dc61e3552b03bd440c39283a75d89f0a2/modules/core/src/utils/filesystem.cpp#L102.
**File:** modules/dnn/src/onnx/onnx_graph_simplifier.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -10,6 +10,8 @@
 #ifdef HAVE_PROTOBUF
 #include "../graph_simplifier.hpp"
 #include "onnx_graph_simplifier.hpp"
+#include <opencv2/core/utils/filesystem.hpp>
+#include "opencv2/core/utils/filesystem.private.hpp"
 
 #include <opencv2/core/utils/logger.hpp>
 #include <queue>
@@ -1704,30 +1706,82 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
```

Review comment:
Most probably it's a bug. I'll take a look.
**File:** modules/dnn/src/onnx/onnx_graph_simplifier.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -10,6 +10,8 @@
 #ifdef HAVE_PROTOBUF
 #include "../graph_simplifier.hpp"
 #include "onnx_graph_simplifier.hpp"
+#include <opencv2/core/utils/filesystem.hpp>
+#include "opencv2/core/utils/filesystem.private.hpp"
 
 #include <opencv2/core/utils/logger.hpp>
 #include <queue>
@@ -1704,30 +1706,82 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
```

Review comment:
redundant empty lines.
**File:** modules/dnn/src/onnx/onnx_graph_simplifier.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -10,6 +10,8 @@
 #ifdef HAVE_PROTOBUF
 #include "../graph_simplifier.hpp"
 #include "onnx_graph_simplifier.hpp"
+#include <opencv2/core/utils/filesystem.hpp>
+#include "opencv2/core/utils/filesystem.private.hpp"
 
 #include <opencv2/core/utils/logger.hpp>
 #include <queue>
@@ -1704,30 +1706,82 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
```

Review comment:
I propose to use CV_check with verbose error message. It's not useful for production usage, but may be practical for development.
**File:** modules/dnn/src/onnx/onnx_graph_simplifier.cpp
**Change Type:** modified
**Context:** PR #27449: Onnx multifile import

**Code Changes:**
```diff
@@ -10,6 +10,8 @@
 #ifdef HAVE_PROTOBUF
 #include "../graph_simplifier.hpp"
 #include "onnx_graph_simplifier.hpp"
+#include <opencv2/core/utils/filesystem.hpp>
+#include "opencv2/core/utils/filesystem.private.hpp"
 
 #include <opencv2/core/utils/logger.hpp>
 #include <queue>
@@ -1704,30 +1706,82 @@ void simplifySubgraphs(opencv_onnx::GraphProto& net)
```

Review comment:
I have changed this to `CV_CheckTrue`
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #27379: cuda: Fix GpuMat::convertTo issues described in 27373

**Code Changes:**
```diff
@@ -240,6 +240,10 @@ class CV_EXPORTS_W GpuMat
 
     //! converts GpuMat to another datatype (Blocking call)
     void convertTo(OutputArray dst, int rtype) const;
+    //! bindings overload which converts GpuMat to another datatype (Blocking call)
+    CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype) const {
+        convertTo(static_cast<OutputArray>(dst), rtype);
+    }
 
     //! converts GpuMat to another datatype (Non-Blocking call)
```

Review comment:
Hm.. It changes Python and Java bindings logic. It requires scale now. Looking on more efficient solution.
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #27379: cuda: Fix GpuMat::convertTo issues described in 27373

**Code Changes:**
```diff
@@ -240,6 +240,10 @@ class CV_EXPORTS_W GpuMat
 
     //! converts GpuMat to another datatype (Blocking call)
     void convertTo(OutputArray dst, int rtype) const;
+    //! bindings overload which converts GpuMat to another datatype (Blocking call)
+    CV_WRAP void convertTo(CV_OUT GpuMat& dst, int rtype) const {
+        convertTo(static_cast<OutputArray>(dst), rtype);
+    }
 
     //! converts GpuMat to another datatype (Non-Blocking call)
```

Review comment:
Its confusing I can't remember why but looking at it now I must have added `double alpha = 1.0` on purpose. I just can't think why I would have done that instead of just adding a bindings overloading to the first function definition. I've added a bindings overload now and all the tests seem to pass but I'm not satisfied!
**File:** hal/ipp/src/warp_ipp.cpp
**Change Type:** modified
**Context:** PR #27519: Move IPP Remap to HAL
**Review Line:** 449

**Code Changes:**
```diff
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //8S
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //16U
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //16S
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //32S
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //32F
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}};  //64F
+
+        if (impl[CV_TYPE(src_type)][CV_MAT_CN(src_type) - 1][interpolation] == 0)
+        {
+            return CV_HAL_ERROR_NOT_IMPLEMENTED;
+        }
```

Review comment:
It's disabled everywhere. Is it expected behaviour?
**File:** hal/ipp/src/warp_ipp.cpp
**Change Type:** modified
**Context:** PR #27519: Move IPP Remap to HAL
**Review Line:** 449

**Code Changes:**
```diff
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //8S
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //16U
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //16S
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //32S
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},   //32F
+                                       {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}};  //64F
+
+        if (impl[CV_TYPE(src_type)][CV_MAT_CN(src_type) - 1][interpolation] == 0)
+        {
+            return CV_HAL_ERROR_NOT_IMPLEMENTED;
+        }
```

Review comment:
Yes, there functional test fails for all cases. I investigate it now, and will enable some cases later.
**File:** cmake/OpenCVBindingsPreprocessorDefinitions.cmake
**Change Type:** added
**Context:** PR #27325: feat: add conditional inclusion support to header parser
**Review Line:** 50

**Code Changes:**
```diff
+  ocv_add_definition(CV_ENABLE_UNROLLED 0)
+  ocv_add_definition(CV__EXCEPTION_PTR 0)
+  ocv_add_definition(CV_NEON 0)
+  ocv_add_definition(TBB_INTERFACE_VERSION 0)
+  ocv_add_definition(CV_SSE2 0)
+  ocv_add_definition(CV_VSX 0)
+  ocv_add_definition(OPENCV_SUPPORTS_FP_DENORMALS_HINT 0)
+  ocv_add_definition(CV_LOG_STRIP_LEVEL 0)
+  ocv_add_definition(CV_LOG_LEVEL_SILENT 0)
+  ocv_add_definition(CV_LOG_LEVEL_FATAL 1)
+  ocv_add_definition(CV_LOG_LEVEL_ERROR 2)
```

Review comment:
I propose to drop it.
**File:** modules/python/src2/hdr_parser.py
**Change Type:** modified
**Context:** PR #27325: feat: add conditional inclusion support to header parser

**Code Changes:**
```diff
@@ -31,11 +31,160 @@
 original_return_type is None if the original_return_type is the same as return_value_type
 """
 
+def evaluate_conditional_inclusion_directive(directive, preprocessor_definitions):
+    """Evaluates C++ conditional inclusion directive.
+    Reference: https://en.cppreference.com/w/cpp/preprocessor/conditional
+
+    Args:
+        directive(str): input C++ conditional directive.
```

Review comment:
```python >>> 'www.example.com'.strip('cmowz.') 'example' ``` What do you want to strip?
**File:** cmake/OpenCVBindingsPreprocessorDefinitions.cmake
**Change Type:** added
**Context:** PR #27325: feat: add conditional inclusion support to header parser
**Review Line:** 50

**Code Changes:**
```diff
+  ocv_add_definition(CV_ENABLE_UNROLLED 0)
+  ocv_add_definition(CV__EXCEPTION_PTR 0)
+  ocv_add_definition(CV_NEON 0)
+  ocv_add_definition(TBB_INTERFACE_VERSION 0)
+  ocv_add_definition(CV_SSE2 0)
+  ocv_add_definition(CV_VSX 0)
+  ocv_add_definition(OPENCV_SUPPORTS_FP_DENORMALS_HINT 0)
+  ocv_add_definition(CV_LOG_STRIP_LEVEL 0)
+  ocv_add_definition(CV_LOG_LEVEL_SILENT 0)
+  ocv_add_definition(CV_LOG_LEVEL_FATAL 1)
+  ocv_add_definition(CV_LOG_LEVEL_ERROR 2)
```

Review comment:
It is not possible to drop it, because header parser parsers "implementation" headers and bumps into lines like: ```cpp #if CV_VSX // something #else // something #endif ```
**File:** modules/python/src2/hdr_parser.py
**Change Type:** modified
**Context:** PR #27325: feat: add conditional inclusion support to header parser

**Code Changes:**
```diff
@@ -31,11 +31,160 @@
 original_return_type is None if the original_return_type is the same as return_value_type
 """
 
+def evaluate_conditional_inclusion_directive(directive, preprocessor_definitions):
+    """Evaluates C++ conditional inclusion directive.
+    Reference: https://en.cppreference.com/w/cpp/preprocessor/conditional
+
+    Args:
+        directive(str): input C++ conditional directive.
```

Review comment:
what if `#ifdef HAVE_XXX`
**File:** cmake/OpenCVBindingsPreprocessorDefinitions.cmake
**Change Type:** added
**Context:** PR #27325: feat: add conditional inclusion support to header parser
**Review Line:** 50

**Code Changes:**
```diff
+  ocv_add_definition(CV_ENABLE_UNROLLED 0)
+  ocv_add_definition(CV__EXCEPTION_PTR 0)
+  ocv_add_definition(CV_NEON 0)
+  ocv_add_definition(TBB_INTERFACE_VERSION 0)
+  ocv_add_definition(CV_SSE2 0)
+  ocv_add_definition(CV_VSX 0)
+  ocv_add_definition(OPENCV_SUPPORTS_FP_DENORMALS_HINT 0)
+  ocv_add_definition(CV_LOG_STRIP_LEVEL 0)
+  ocv_add_definition(CV_LOG_LEVEL_SILENT 0)
+  ocv_add_definition(CV_LOG_LEVEL_FATAL 1)
+  ocv_add_definition(CV_LOG_LEVEL_ERROR 2)
```

Review comment:
hm.. need to check.
**File:** modules/python/src2/hdr_parser.py
**Change Type:** modified
**Context:** PR #27325: feat: add conditional inclusion support to header parser
**Review Line:** 154

**Code Changes:**
```diff
+    except Exception as e:
+        raise ValueError(
+            "Failed to evaluate '{}' directive, stripped down to '{}'".format(
+                input_directive, directive
+            )
+        ) from e
+
+    if not isinstance(eval_directive, (bool, int)):
+        raise TypeError(
+            "'{}' directive is evaluated to unexpected type: {}".format(
+                input_directive, type(eval_directive).__name__
```

Review comment:
It requires Python update. I notified Alexander about it.
**File:** cmake/OpenCVFindLibsPerf.cmake
**Change Type:** modified
**Context:** PR #27536: eigen: fix to get version from eigen after v3.4.0

**Code Changes:**
```diff
@@ -84,7 +84,13 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN)
         set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION})
         set(EIGEN_MAJOR_VERSION ${EIGEN3_MAJOR_VERSION})
         set(EIGEN_MINOR_VERSION ${EIGEN3_MINOR_VERSION})
-      else()  # Eigen config file
+      elseif(DEFINED Eigen3_VERSION_MAJOR) # Recommended package config variables
+        # see https://github.com/opencv/opencv/issues/27530
+        set(EIGEN_WORLD_VERSION ${Eigen3_VERSION_MAJOR})
+        set(EIGEN_MAJOR_VERSION ${Eigen3_VERSION_MINOR})
+        set(EIGEN_MINOR_VERSION ${Eigen3_VERSION_PATCH})
```

Review comment:
It'll be great to add pointer to Eigen commit or MR instead of just date.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #27551: Add enum IMWRITE_PNG_ZLIBBUFFER_SIZE

**Code Changes:**
```diff
@@ -947,26 +947,36 @@ bool  PngEncoder::write( const Mat& img, const std::vector<int>& params )
 
                 for( size_t i = 0; i < params.size(); i += 2 )
                 {
-                    if( params[i] == IMWRITE_PNG_COMPRESSION )
+                    switch (params[i])
                     {
+                    case IMWRITE_PNG_COMPRESSION:
                         m_compression_strategy = IMWRITE_PNG_STRATEGY_DEFAULT; // Default strategy
                         m_compression_level = params[i+1];
```

Review comment:
It's invalid imwrite option. I propose CV_Error here instead of silent ignore.
**File:** modules/imgcodecs/test/test_png.cpp
**Change Type:** modified
**Context:** PR #27551: Add enum IMWRITE_PNG_ZLIBBUFFER_SIZE

**Code Changes:**
```diff
@@ -12,14 +12,15 @@ TEST(Imgcodecs_Png, write_big)
 {
     const string root = cvtest::TS::ptr()->get_data_path();
     const string filename = root + "readwrite/read.png";
-    const string dst_file = cv::tempfile(".png");
     Mat img;
     ASSERT_NO_THROW(img = imread(filename));
     ASSERT_FALSE(img.empty());
     EXPECT_EQ(13043, img.cols);
     EXPECT_EQ(13917, img.rows);
```

Review comment:
Does ZLIB buffer size affects output size? I expect - no. I do not think we can efficiently test the option.
**File:** modules/imgcodecs/test/test_png.cpp
**Change Type:** modified
**Context:** PR #27551: Add enum IMWRITE_PNG_ZLIBBUFFER_SIZE

**Code Changes:**
```diff
@@ -12,14 +12,15 @@ TEST(Imgcodecs_Png, write_big)
 {
     const string root = cvtest::TS::ptr()->get_data_path();
     const string filename = root + "readwrite/read.png";
-    const string dst_file = cv::tempfile(".png");
     Mat img;
     ASSERT_NO_THROW(img = imread(filename));
     ASSERT_FALSE(img.empty());
     EXPECT_EQ(13043, img.cols);
     EXPECT_EQ(13917, img.rows);
```

Review comment:
Increasing the zlib buffer size can reduce the number of IDAT chunks in large PNG images, resulting in slightly smaller output file sizes. `imencode(".png", img, buff));` result buff.size() will be **817407** `imencode(".png", img, buff, { IMWRITE_PNG_ZLIBBUFFER_SIZE, 2 << 15 })` result buff.size() will be **816363** `imencode(".png", img, buff, { IMWRITE_PNG_ZLIBBUFFER_SIZE, 4096 })` result buff.size() will be **818607**
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #27551: Add enum IMWRITE_PNG_ZLIBBUFFER_SIZE
**Review Line:** 979

**Code Changes:**
```diff
+                        png_set_compression_buffer_size(png_ptr, params[i+1]);
+                        break;
+
+                    default:
+                        CV_LOG_WARNING(NULL, "An unknown or unsupported ImwriteFlags value was specified and has been ignored.");
+                        break;
                     }
                 }
 
```

Review comment:
The error is user input error in code and definitely means some bug. The common rule in OpenCV is to use CV_Assert and throw exceptions for the developer mistakes, but not ignore it. I propose to return back CV_Error and merge it.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #27551: Add enum IMWRITE_PNG_ZLIBBUFFER_SIZE
**Review Line:** 979

**Code Changes:**
```diff
+                        png_set_compression_buffer_size(png_ptr, params[i+1]);
+                        break;
+
+                    default:
+                        CV_LOG_WARNING(NULL, "An unknown or unsupported ImwriteFlags value was specified and has been ignored.");
+                        break;
                     }
                 }
 
```

Review comment:
i propose creating an issue and plan to change this behavior in OpenCV 5
**File:** modules/dnn/src/layers/trilu_layer.cpp
**Change Type:** added
**Context:** PR #27527: Trilu layer

**Code Changes:**
```diff
@@ -0,0 +1,85 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "../precomp.hpp"
+#include <opencv2/dnn/shape_utils.hpp>
+using namespace std;
+namespace cv { namespace dnn {
+
```

Review comment:
extra empty line.
**File:** modules/dnn/src/layers/trilu_layer.cpp
**Change Type:** added
**Context:** PR #27527: Trilu layer

**Code Changes:**
```diff
@@ -0,0 +1,85 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "../precomp.hpp"
+#include <opencv2/dnn/shape_utils.hpp>
+using namespace std;
+namespace cv { namespace dnn {
+
```

Review comment:
`uppertri` -> `upperTri`
**File:** modules/dnn/src/init.cpp
**Change Type:** modified
**Context:** PR #27527: Trilu layer

**Code Changes:**
```diff
@@ -186,6 +186,7 @@ void initializeLayerFactory()
     CV_DNN_REGISTER_LAYER_CLASS(DepthToSpaceInt8, DepthToSpaceLayer)
     CV_DNN_REGISTER_LAYER_CLASS(SpaceToDepthInt8, SpaceToDepthLayer)
 
+    CV_DNN_REGISTER_LAYER_CLASS(Trilu,          TriluLayer);
     CV_DNN_REGISTER_LAYER_CLASS(Crop,           CropLayer);
     CV_DNN_REGISTER_LAYER_CLASS(Eltwise,        EltwiseLayer);
     CV_DNN_REGISTER_LAYER_CLASS(NaryEltwise,    NaryEltwiseLayer);
```

Review comment:
Not needed most probably.
**File:** modules/dnn/src/layers/trilu_layer.cpp
**Change Type:** added
**Context:** PR #27527: Trilu layer

**Code Changes:**
```diff
@@ -0,0 +1,85 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "../precomp.hpp"
+#include <opencv2/dnn/shape_utils.hpp>
+using namespace std;
+namespace cv { namespace dnn {
+
```

Review comment:
Please remove. It's not needed.