diff --git a/dlib/image_transforms/random_cropper.h b/dlib/image_transforms/random_cropper.h index 4331459d1..26e4fa8b2 100644 --- a/dlib/image_transforms/random_cropper.h +++ b/dlib/image_transforms/random_cropper.h @@ -194,8 +194,8 @@ namespace dlib { // set to ignore if not totally in the crop or if too small. if (!get_rect(crop).contains(rect.rect) || - (rect.rect.height() < min_object_length_long_dim && rect.rect.width() < min_object_length_long_dim) || - (rect.rect.height() < min_object_length_short_dim || rect.rect.width() < min_object_length_short_dim)) + ((long)rect.rect.height() < min_object_length_long_dim && (long)rect.rect.width() < min_object_length_long_dim) || + ((long)rect.rect.height() < min_object_length_short_dim || (long)rect.rect.width() < min_object_length_short_dim)) { rect.ignore = true; }