Commit Graph

266 Commits

Author SHA1 Message Date
Alexander Alekhin
45428b897f imgcodecs(tiff): avoid leak of helper struct on malformed inputs
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13285
2019-03-31 11:50:33 +00:00
Alexander Alekhin
26087e28ad Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-15 22:42:57 +00:00
Alexander Alekhin
43c68d1864 imgcodecs: OPENCV_IO_ENABLE_JASPER runtime parameter 2019-03-14 21:43:24 +00:00
Alexander Alekhin
bd1fd59fc1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-13 19:13:13 +00:00
rpici
9cca066ee8
Fix bug in test_tiff.cpp
The big endian data in the tiff_sample_data array was never being tested.  This could be observed by e.g. changing the 9th byte in the big endian data from 0xde to something that should fail the test, e.g. 0xdd, and the test would still pass even though it should fail.
2019-03-13 09:42:47 -05:00
Alexander Alekhin
8c0b0714e7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-11 19:20:22 +00:00
Gregor Mittag
d71977b4dd Add JPEG2000 compression flag. 2019-03-10 07:59:09 +01:00
Rajkiran Natarajan
40af53b1d6 issue-13921: Support setting compression setting for writing tiff images 2019-03-09 15:48:21 -05:00
klemens
997b7b18af spelling fixes 2019-02-09 22:29:54 +01:00
Alexander Alekhin
ea64e860de Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-09 13:21:58 +00:00
LaurentBerger
f1dc26d7ce Merge pull request #13382 from LaurentBerger:imreadsize
* try to solve #13381

* Add note
2018-12-09 15:05:27 +03:00
Alexander Alekhin
c0016d7fe9
Merge pull request #13253 from alalek:fix_13201
* cmake: install 'legacy/constants_c.h' files

* samples: add compatibility test code
2018-11-23 20:02:46 +03:00
pascal
7579cd8068 updated documentation for imread and imwrite (added pfm image format) 2018-11-21 17:59:37 +01:00
Alexander Alekhin
a574788e89 move legacy C-API constants into separate files 2018-11-17 23:47:51 +00:00
Alexander Alekhin
1913482cf5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-10 20:50:26 +00:00
Vadim Pisarevsky
11eafca3e2
removed C API in the following modules: photo, video, imgcodecs, videoio (#13060)
* removed C API in the following modules: photo, video, imgcodecs, videoio

* trying to fix various compile errors and warnings on Windows and Linux

* continue to fix compile errors and warnings

* continue to fix compile errors, warnings, as well as the test failures

* trying to resolve compile warnings on Android

* Update cap_dc1394_v2.cpp

fix warning from the new GCC
2018-11-09 00:52:09 +03:00
Alexander Alekhin
b74b05d1b3 Revert CV_TRY/CV_CATCH macros
This reverts commit 7349b8f5ce (partially).
2018-11-08 19:56:52 +03:00
Alexander Alekhin
687fa6a8ca Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-02 05:33:35 +00:00
Ilari Venäläinen
e6c41f0de6 Merge pull request #12989 from venalil:fix_thresholded_tiff_read
* Fix reading of black-and-white (thresholded) TIFF images

I recently updated my local OpenCV version to 3.4.3 and found out that
I could not read my TIFF images related to my project. After debugging I
found out that there has been some static analysis fixes made
that accidentally have broken reading those black-and-white TIFF images.

Commit hash in which reading of mentioned TIFF images has been broken:
cbb1e867e5

Basically the fix is to revert back to the same functionality that has been there before,
when black-and-white images are read bpp (bitspersample) is 1.
Without the case 1: this TiffDecoder::readHeader() function always return false.

* Added type and default error message

* Added stdexcept include

* Use CV_Error instead of throw std::runtime_error

* imgcodecs(test): add TIFF B/W decoding tests
2018-11-01 14:34:34 +03:00
Suleyman TURKMEN
4d0ed5c13c Merge pull request #12971 from sturkmen72:upd_imgproc_hpp
* Update imgproc.hpp

* update color conversion codes
2018-10-31 18:08:24 +03:00
Maksim Shabunin
0ccd810738 Fixed several issues found by static analysis 2018-10-25 10:45:59 +03:00
Alexander Alekhin
5115e5decb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-13 16:19:05 +00:00
drkoller
978ad4981e Clean up documentation for imread and imwrite 2018-10-12 17:08:01 -04:00
Alexander Alekhin
690fb0544c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-02 14:31:05 +03:00
Alexander Alekhin
9253e8bda2
Merge pull request #12705 from berak:imread_document_grayscale 2018-09-30 23:59:48 +03:00
berak
df4139d373 document imread grayscale behaviour 2018-09-30 15:22:26 +02:00
Alexander Alekhin
dca657a2fd Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-10 00:10:21 +03:00
cyy
286c2c236b Merge pull request #12458 from DEEPIR:3.4
* may be an typo fix

* remove identical branch,may be paste error

* add parentheses around macro parameter

* simplify if condition

* check malloc fail

* change the condition of branch removed by commit 3041502861
2018-09-07 18:43:47 +03:00
Alexander Alekhin
73bfe68821 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-07 12:40:27 +03:00
Alexander Alekhin
8a3c394d6a don't use constructors for C API structures 2018-09-06 14:34:16 +03:00
Alexander Alekhin
d74b98c3d9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-04 18:39:03 +00:00
Alexander Alekhin
acce95f446 backport fixes for static analyzer warnings
Commits:
- 09837928d9
- 10fb88d027

Excluded changes with std::atomic (C++98 requirement)
2018-09-04 16:49:42 +03:00
cyy
10fb88d027 Merge pull request #12391 from DEEPIR:master
fix some errors found by static analyzer. (#12391)

* fix possible divided by zero and by negative values

* only 4 elements are used in these arrays

* fix uninitialized member

* use boolean type for semantic boolean variables

* avoid invalid array index

* to avoid exception and because base64_beg is only used in this block

* use std::atomic<bool> to avoid thread control race condition
2018-09-04 16:39:19 +03:00
Alexander Alekhin
20bf7b6a79 imgcodecs(webp): use safe cast to size_t on Win32 2018-09-02 10:00:52 +00:00
Jakub Golinowski
9f1218b00b Merge pull request #11897 from Jakub-Golinowski:hpx_backend
* Add HPX backend for OpenCV implementation
Adds hpx backend for cv::parallel_for_() calls respecting the nstripes chunking parameter. C++ code for the backend is added to modules/core/parallel.cpp. Also, the necessary changes to cmake files are introduced.
Backend can operate in 2 versions (selectable by cmake build option WITH_HPX_STARTSTOP): hpx (runtime always on) and hpx_startstop (start and stop the backend for each cv::parallel_for_() call)

* WIP: Conditionally include hpx_main.hpp to tests in core module
Header hpx_main.hpp is included to both core/perf/perf_main.cpp and core/test/test_main.cpp.
The changes to cmake files for linking hpx library to above mentioned test executalbles are proposed but have issues.

* Add coditional iclusion of hpx_main.hpp to cpp cpu modules

* Remove start/stop version of hpx backend
2018-08-31 16:23:26 +03:00
Vadim Pisarevsky
4b03a4a841 Merge pull request #12353 from alalek:imgcodecs_fix_webp 2018-08-31 13:03:10 +00:00
Alexander Alekhin
0d4fd20a73 imgcodecs: add null pointer check 2018-08-31 12:56:02 +03:00
Alexander Alekhin
0515f930e8 imgcodecs(webp): multiple fixes
- don't reallocate passed 'img' (test fixed - must use IMREAD_UNCHANGED / IMREAD_ANYCOLOR)
- avoid memory DDOS
- avoid reading of whole file during header processing
- avoid data access after allocated buffer during header processing (missing checks)
- use WebPFree() to free allocated buffers (libwebp >= 0.5.0)
- drop unused & undefined `.close()` method
- added checks for channels >= 5 in encoder
2018-08-30 20:42:33 +00:00
Alexander Alekhin
6356403964 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-08-22 17:38:51 +03:00
Colin Smith
76f47548b3 Add export macro for ios conversion functions 2018-08-20 14:10:54 -07:00
pasbi
76eb389761 Merge pull request #12240 from pasbi:pfm_fix
* fixed 64-float pfm auto conversion

* removed trailing whitespace
2018-08-17 18:53:09 +03:00
pasbi
9f5f64e14e Merge pull request #12192 from pasbi:pfm
* created new decoder and encoder for PFM

pfm file format stores binary RGB or grayscale float images.

* added test for pfm codec

* replaced large with short licence header

* little/big-endian-check is now compile time

* fixed width/height confusion, improved big/little endian recognition, fixed scaling issue and Improved signature check

* adapted tests to handle float images well

* removed data-dependency: lena.pfm

the lena image is now loaded is pam and converted to pfm.

* fixed bug in endianess detection macro

* Added endianess detection for android and win

* removed fancy endianess detection

endianess detection will be implemented in cmake scripts soonish.

* fixed minor warnings

* fixed stupid elif defined bug

* silenced some implicit cast warnings

* replaced std::to_string with std::stringstream solution

std::to_string variant did not build on android.

* replaced new endianess macros with existing ones

* improved readability
2018-08-13 13:14:12 +03:00
Maksim Shabunin
cbb1e867e5 More issues found by static analysis 2018-07-24 16:04:42 +03:00
Alexander Alekhin
b09a4a98d4 opencv: Use cv::AutoBuffer<>::data() 2018-07-04 19:11:29 +03:00
Alexander Alekhin
5557474467 imgcodecs(sunras): avoid buffer overrun
`src_pitch` may be large than data `step`
2018-07-02 12:56:50 +03:00
Alexander Alekhin
2f9b4439af Merge pull request #11565 from alalek:issue_11545 2018-05-22 16:00:37 +00:00
Alexander Enaldiev
84584002f2 Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats
* imgcodecs cmake: the option to customize supported formats list (WITH_IMGCODEC_HDR, WITH_IMGCODEC_SUNRASTER, WITH_IMGCODEC_PXM)

* imgcodecs: fixes

- fixed CMake scripts (=OFF doesn't really work)
- restore dropped GDCM block
- added _IMGCODEC_ prefix
- fixed tests
- include PAM format under WITH_IMGCODEC_PXM option
2018-05-22 15:10:15 +00:00
Alexander Alekhin
35a4551609 imgcodecs: fix imwrite handling of different OutputArray types 2018-05-22 13:57:51 +03:00
Alexander Alekhin
76ac7ab4ef imgcodecs: added test for imwrite parameter types
issue 11545
2018-05-22 13:55:14 +03:00
Alexander Alekhin
f8252702a8 3rdparty: integrate libjpeg-turbo build scripts into OpenCV 2018-05-11 18:29:57 +03:00