Skip to content

Commit

Permalink
Merge pull request opencv#17006 from tpoisonooo:patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Apr 11, 2020
2 parents 9c58a7c + b11a3a0 commit 43ff8f8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/imgcodecs/src/grfmt_pxm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,9 @@ bool PxMEncoder::write(const Mat& img, const std::vector<int>& params)
// write header;
const int code = ((mode == PXM_TYPE_PBM) ? 1 : (mode == PXM_TYPE_PGM) ? 2 : 3)
+ (isBinary ? 3 : 0);
const char* comment = "# Generated by OpenCV " CV_VERSION "\n";

int header_sz = sprintf(buffer, "P%c\n%s%d %d\n",
(char)('0' + code), comment,
width, height);
int header_sz = sprintf(buffer, "P%c\n%d %d\n",
(char)('0' + code), width, height);
CV_Assert(header_sz > 0);
if (mode != PXM_TYPE_PBM)
{
Expand Down

0 comments on commit 43ff8f8

Please sign in to comment.