Skip to content

Commit

Permalink
round dimensions when scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
Walt Lin committed Oct 5, 2011
1 parent 977c218 commit 36dde24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ int DoTransform(int cols, int rows, bool crop_to_size,
if (crop_to_size && fabs(xs - ys) > 0.001) {
int width = std::min(cur->Xsize, cols);
int height = std::min(cur->Ysize, rows);
int left = (cur->Xsize - width) / 2;
int top = (cur->Ysize - height) / 2;
int left = (cur->Xsize - width + 1) / 2;
int top = (cur->Ysize - height + 1) / 2;

if (DEBUG) {
fprintf(stderr, "size %dx%d, extract left=%d top=%d "
Expand Down

0 comments on commit 36dde24

Please sign in to comment.