Skip to content

Conversation

@oltodosel
Copy link

int size_r = width * height;
unsigned char* image_rev = new unsigned char[size_r];
for (int i = 0; i < size_r; i++)
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the bracket placement is inconsistent with the rest of the file


if (inverting_images) {
int size_r = width * height;
unsigned char* image_rev = new unsigned char[size_r];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never free that pointer.

bool inverting_images = true;

if (inverting_images) {
int size_r = width * height;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be size_t. Probably size_t const

unsigned char* image_rev = new unsigned char[size_r];
for (int i = 0; i < size_r; i++)
{
int val = static_cast<int>(image[i]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the cast?

@oltodosel
Copy link
Author

I have zero experience with C. This seemed to have solved the problem I've had with tesseract 4.

Geoffrey-A added a commit to Geoffrey-A/VobSub2SRT that referenced this pull request Jun 21, 2020
This contains the following PRs:
- ruediger#72 by bit: Fix compile with gcc7 and tesseract 4
- ruediger#75 by oltodosel: inverting images for tesseract 4
Geoffrey-A added a commit to Geoffrey-A/VobSub2SRT that referenced this pull request Jun 21, 2020
Geoffrey-A added a commit to Geoffrey-A/VobSub2SRT that referenced this pull request Jun 21, 2020
This contains the following PRs:
- ruediger#72 by @bit: Fix compile with gcc7 and tesseract 4
- ruediger#75 by @oltodosel: inverting images for tesseract 4
Geoffrey-A added a commit to Geoffrey-A/VobSub2SRT that referenced this pull request Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants