Skip to content

Commit

Permalink
fix image cutoff due to lost pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
Like4Schnitzel committed Mar 5, 2024
1 parent 6fd9e11 commit d11dbb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/img-viewer/imgviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ void ImgViewer::transcode(const int width, const int height)
this->height = height;
transcodedFile.resize(width*height);

const int widthPixelsPerChar = file.size().width / this->width;
const int heightPixelsPerChar = file.size().height / this->height;
const double widthPixelsPerChar = (double) file.size().width / this->width;
const double heightPixelsPerChar = (double) file.size().height / this->height;

int charIndex = 0;
std::vector<std::thread> threads;
Expand Down
4 changes: 2 additions & 2 deletions src/transcoder/videotranscoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ std::shared_ptr<CharInfo []> VideoTranscoder::transcodeFrame()
std::shared_ptr<CharInfo[]> frameInfo = std::make_shared<CharInfo[]>(vidTWidth*vidTHeight);
int charIndex = 0;

const int widthPixelsPerChar = vidWidth / vidTWidth;
const int heightPixelsPerChar = vidHeight / vidTHeight;
const double widthPixelsPerChar = (double) vidWidth / vidTWidth;
const double heightPixelsPerChar = (double) vidHeight / vidTHeight;

std::vector<std::thread> threads;
threads.reserve(vidTHeight);
Expand Down

0 comments on commit d11dbb7

Please sign in to comment.