nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/test/test_houghlines.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough
**Review Line:** 355

**Code Changes:**
```diff
+
+    // detect lines
+    std::vector<Vec2f> lines;
+    int threshold{220*25-1};
+    bool use_edgeval{true};
+    HoughLines(img, lines, 1, CV_PI/180, threshold, 0, 0, 0.0, CV_PI, use_edgeval);
+
+    // check results
+    ASSERT_EQ(3U, lines.size());
+    // detected lines is assumed sorted from stronger to weaker.
+    EXPECT_EQ(12, lines[0][0]);
```

Review comment:
BTW, test doesn't look representative. ``` int threshold{25-1}; HoughLines(img, lines, 1, CV_PI/180, threshold, 0, 0, 0.0, CV_PI); ``` works well without this patch. if HoughLines() input comes from Canny() then this input is in set of `[0, 255]` without intermediate values. How is intermediate values could be prepared on edges?
**File:** modules/imgproc/test/test_houghlines.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -340,6 +340,53 @@ TEST(HoughLines, regression_21983)
     EXPECT_NEAR(lines[0][1], 1.57179642, 1e-4);
 }
 
+TEST(WeightedHoughLines, horizontal)
+{
+    Mat img(25, 25, CV_8UC1, Scalar(0));
+    // draw lines. from top to bottom, stronger to weaker.
+    line(img, Point(0, 6), Point(25, 6), Scalar(240));
+    line(img, Point(0, 12), Point(25, 12), Scalar(255));
```

Review comment:
I'm sorry. I fixed it.
**File:** modules/imgproc/test/test_houghlines.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough
**Review Line:** 355

**Code Changes:**
```diff
+
+    // detect lines
+    std::vector<Vec2f> lines;
+    int threshold{220*25-1};
+    bool use_edgeval{true};
+    HoughLines(img, lines, 1, CV_PI/180, threshold, 0, 0, 0.0, CV_PI, use_edgeval);
+
+    // check results
+    ASSERT_EQ(3U, lines.size());
+    // detected lines is assumed sorted from stronger to weaker.
+    EXPECT_EQ(12, lines[0][0]);
```

Review comment:
Just a moment please for the fixation. I'm still struggling to build latest 4.x branch. I reported my error [here](https://github.com/opencv/opencv/issues/26620)
**File:** modules/imgproc/test/test_houghlines.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough
**Review Line:** 355

**Code Changes:**
```diff
+
+    // detect lines
+    std::vector<Vec2f> lines;
+    int threshold{220*25-1};
+    bool use_edgeval{true};
+    HoughLines(img, lines, 1, CV_PI/180, threshold, 0, 0, 0.0, CV_PI, use_edgeval);
+
+    // check results
+    ASSERT_EQ(3U, lines.size());
+    // detected lines is assumed sorted from stronger to weaker.
+    EXPECT_EQ(12, lines[0][0]);
```

Review comment:
Now I fixed the unit test. and confirmed it. If I set " use_edgeval{false}" for both TEST(WeightedHoughLines, horizontal), and TEST(WeightedHoughLines, diagonal), and run the command; ```bash $ ./ext/sensyn-opencv/bin/opencv_test_imgproc --gtest_filter=WeightedHoughLines.* ``` , it fails as below; ```test_log [==========] Running 2 tests from 1 test case. [----------] Global test environment set-up. [----------] 2 tests from WeightedHoughLines [ RUN ] WeightedHoughLines.horizontal /home/mas/proj/sensyn/sensyn-vision/ext/sensyn-opencv/modules/imgproc/test/test_houghlines.cpp:358: Failure Expected equality of these values: 3 lines.size() Which is: 0 [ FAILED ] WeightedHoughLines.horizontal (1 ms) [ RUN ] WeightedHoughLines.diagonal /home/mas/proj/sensyn/sensyn-vision/ext/sensyn-opencv/modules/imgproc/test/test_houghlines.cpp:382: Failure Expected equality of these values: 2 lines.size() Which is: 0 [ FAILED ] WeightedHoughLines.diagonal (0 ms) [----------] 2 tests from WeightedHoughLines (1 ms total) [----------] Global test environment tear-down [==========] 2 tests from 1 test case ran. (1 ms total) [ PASSED ] 0 tests. [ FAILED ] 2 tests, listed below: [ FAILED ] WeightedHoughLines.horizontal [ FAILED ] WeightedHoughLines.diagonal 2 FAILED TESTS ``` But when I revised to "use_edgeval{true}" again as the pushed code, the result become success as below. ```test_log [==========] Running 2 tests from 1 test case. [----------] Global test environment set-up. [----------] 2 tests from WeightedHoughLines [ RUN ] WeightedHoughLines.horizontal [ OK ] WeightedHoughLines.horizontal (1 ms) [ RUN ] WeightedHoughLines.diagonal [ OK ] WeightedHoughLines.diagonal (0 ms) [----------] 2 tests from WeightedHoughLines (1 ms total) [----------] Global test environment tear-down [==========] 2 tests from 1 test case ran. (1 ms total) [ PASSED ] 2 tests. ```
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough
**Review Line:** 176

**Code Changes:**
```diff
+      double x0 = r*cos_t, y0 = r*sin_t;
+      double alpha = 1000;
+
+       Point pt1( cvRound(x0 + alpha*(-sin_t)), cvRound(y0 + alpha*cos_t) );
+       Point pt2( cvRound(x0 - alpha*(-sin_t)), cvRound(y0 - alpha*cos_t) );
+       line( weighted_hough, pt1, pt2, Scalar(255,0,0), 3, LINE_AA );
+     }
+
+   imshow( weighted_name, weighted_hough );
+}
```

Review comment:
Classic Hough transform and probablistic versions return lines in Cartesian coordinate system. You version implements polar version. I propose to return back to Cartesian and I'll merge the patch.
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough
**Review Line:** 176

**Code Changes:**
```diff
+      double x0 = r*cos_t, y0 = r*sin_t;
+      double alpha = 1000;
+
+       Point pt1( cvRound(x0 + alpha*(-sin_t)), cvRound(y0 + alpha*cos_t) );
+       Point pt2( cvRound(x0 - alpha*(-sin_t)), cvRound(y0 - alpha*cos_t) );
+       line( weighted_hough, pt1, pt2, Scalar(255,0,0), 3, LINE_AA );
+     }
+
+   imshow( weighted_name, weighted_hough );
+}
```

Review comment:
I'm very sorry for not being able to fix nor respond. When I have time, I will definitely fix based on your request.
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -15,22 +15,27 @@ using namespace std;
 /// Global variables
 
 /** General variables */
-Mat src, edges;
+Mat src, canny_edge, sobel_edge;
 Mat src_gray;
-Mat standard_hough, probabilistic_hough;
+Mat standard_hough, probabilistic_hough, weighted_hough;
 int min_threshold = 50;
```

Review comment:
MS Visual Studio reports warning here. Please use 100000. See CI logs for details.
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -15,22 +15,27 @@ using namespace std;
 /// Global variables
 
 /** General variables */
-Mat src, edges;
+Mat src, canny_edge, sobel_edge;
 Mat src_gray;
-Mat standard_hough, probabilistic_hough;
+Mat standard_hough, probabilistic_hough, weighted_hough;
 int min_threshold = 50;
```

Review comment:
Oh I'm very sorry. Now I'm fixing and checking the build procedure. I will push after I confirmed it build without error.
**File:** samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
**Change Type:** modified
**Context:** PR #21407: Feature: weighted hough

**Code Changes:**
```diff
@@ -15,22 +15,27 @@ using namespace std;
 /// Global variables
 
 /** General variables */
-Mat src, edges;
+Mat src, canny_edge, sobel_edge;
 Mat src_gray;
-Mat standard_hough, probabilistic_hough;
+Mat standard_hough, probabilistic_hough, weighted_hough;
 int min_threshold = 50;
```

Review comment:
I think I fixed the 2 errors in the CI. But github workflow seems only run on branch 4.x, so I couldn't confirmed the fixation. Could you check it by running CI?
**File:** platforms/android/default.config.py
**Change Type:** added
**Context:** PR #26057: Android builds update

**Code Changes:**
```diff
@@ -0,0 +1,6 @@
+ABIs = [
+    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
+    ABI("3", "arm64-v8a",   None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("5", "x86_64",      None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("4", "x86",         None, 21),
+]
```

Review comment:
Makes sense for "Android NDK r27 and higher" according to documentation. Why do not enable that by default in the main build_sdk.py script?
**File:** platforms/android/default.config.py
**Change Type:** added
**Context:** PR #26057: Android builds update

**Code Changes:**
```diff
@@ -0,0 +1,6 @@
+ABIs = [
+    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
+    ABI("3", "arm64-v8a",   None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("5", "x86_64",      None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("4", "x86",         None, 21),
+]
```

Review comment:
I want to switch CI to the default configuration and always build SDK and AAR packages with 16kb pages support. The packages will work with both old and new memory configuration. It just tunes ELF sections alignment a bit. The option will be ignored with NDK before 27.
**File:** platforms/android/default.config.py
**Change Type:** added
**Context:** PR #26057: Android builds update

**Code Changes:**
```diff
@@ -0,0 +1,6 @@
+ABIs = [
+    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
+    ABI("3", "arm64-v8a",   None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("5", "x86_64",      None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("4", "x86",         None, 21),
+]
```

Review comment:
```suggestion ABI("3", "arm64-v8a", None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')), ```
**File:** platforms/android/default.config.py
**Change Type:** added
**Context:** PR #26057: Android builds update

**Code Changes:**
```diff
@@ -0,0 +1,6 @@
+ABIs = [
+    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
+    ABI("3", "arm64-v8a",   None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("5", "x86_64",      None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')),
+    ABI("4", "x86",         None, 21),
+]
```

Review comment:
Same issue here: ```suggestion ABI("5", "x86_64", None, 21, cmake_vars=dict(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES='ON')), ```
**File:** cmake/OpenCVCompilerOptions.cmake
**Change Type:** modified
**Context:** PR #26057: Android builds update
**Review Line:** 409

**Code Changes:**
```diff
   endif()
 endif()
 
+# For 16k pages support with NDK prior 27
+# Details: https://developer.android.com/guide/practices/page-sizes?hl=en
+if(ANDROID AND ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES AND (ANDROID_ABI STREQUAL arm64-v8a OR ANDROID_ABI STREQUAL x86_64))
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
+endif()
+
```

Review comment:
> ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES `OPENCV_ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES` to avoid possible conflicts
**File:** modules/imgcodecs/src/grfmt_png.hpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -47,34 +47,124 @@
 
 #include "grfmt_base.hpp"
 #include "bitstrm.hpp"
+#include <png.h>
+#include <zlib.h>
 
 namespace cv
 {
 
```

Review comment:
Shouldn't this function be static? Does it even need to be a member function?
**File:** modules/imgcodecs/src/grfmt_png.hpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -47,34 +47,124 @@
 
 #include "grfmt_base.hpp"
 #include "bitstrm.hpp"
+#include <png.h>
+#include <zlib.h>
 
 namespace cv
 {
 
```

Review comment:
Isn't it the case for the .cpp file though?
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
If you have a commented block, put it in an `#If 0` and please explain why it is now commented out.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
Some of those members are unset right now because the user does not send them. The writemulti API is not good enough to write an animation.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
this part was for only test
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
please sort the headers. iostream is most likely useless.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
those functions belong to an anonymous namespace.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
Please use CV_LOG_DEBUG instead of printf
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
Please use `!isalpha()`
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
Please do not use new as it makes its hard to track memory. Use std::vector<char> if you can.
**File:** modules/imgcodecs/src/grfmt_png.hpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -47,34 +47,124 @@
 
 #include "grfmt_base.hpp"
 #include "bitstrm.hpp"
+#include <png.h>
+#include <zlib.h>
 
 namespace cv
 {
 
```

Review comment:
It's ok to keep this API for now, for debugging, but I'd like to see a proper animation API, maybe in private, that starts taking into account the frame durations.
**File:** modules/imgcodecs/src/grfmt_png.hpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -47,34 +47,124 @@
 
 #include "grfmt_base.hpp"
 #include "bitstrm.hpp"
+#include <png.h>
+#include <zlib.h>
 
 namespace cv
 {
 
```

Review comment:
this is not standard, please use `unsigned int` or `uint32_t`
**File:** modules/imgcodecs/src/grfmt_png.hpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -47,34 +47,124 @@
 
 #include "grfmt_base.hpp"
 #include "bitstrm.hpp"
+#include <png.h>
+#include <zlib.h>
 
 namespace cv
 {
 
```

Review comment:
please use `unsigned char`
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
mf is not checked.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
fread may read less bytes than expected. Imread should close the file and return false in the case.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
I propose ``` uint32_t PngDecoder::read_chunk(CHUNK& pChunk) ``` NULL is not possible then.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
I propose to use `std::vector` or `cv::AutoBuffer` to prevent memory leaks.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
The same to prevent leaks.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support
**Review Line:** 1341

**Code Changes:**
```diff
+        {
+            *dp++ = 0;
+            memcpy(dp, row, rowbytes);
+            dp += rowbytes;
+            row += stride;
+        }
+    }
+    else
+        processRect(row, rowbytes, bpp, stride, op[n].h, rows);
+
+    z_stream fin_zstream;
```

Review comment:
For asmorkalov: Need to check.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
Print error with CV_LOG_ERROR and return false from imread. There should not be silent failures.
**File:** modules/imgcodecs/src/grfmt_png.cpp
**Change Type:** modified
**Context:** PR #25715: Animated PNG Support

**Code Changes:**
```diff
@@ -51,21 +51,66 @@
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+/****************************************************************************\
+ *
+ *  this file includes some modified part of apngasm and APNG Optimizer 1.4
+ *  both have zlib license.
+ *
+ ****************************************************************************/
```

Review comment:
It'll be great to use named constants here.