@@ -283,8 +283,7 @@ TEST_F(image_resize_test, resize_real_landscape_void_version)
283283 std::vector<std::uint8_t > resized_image (target_width * target_height * orig_channels, 0 );
284284
285285 EXPECT_NO_THROW ({
286- tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
287- target_width, target_height, resized_image);
286+ tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_width, target_height, resized_image);
288287 });
289288
290289 // Verify the resized image has correct dimensions
@@ -316,8 +315,7 @@ TEST_F(image_resize_test, resize_real_landscape_return_version)
316315
317316 std::vector<std::uint8_t > resized_image;
318317 EXPECT_NO_THROW ({
319- resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
320- target_width, target_height);
318+ resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_width, target_height);
321319 });
322320
323321 // Verify the resized image has correct dimensions
@@ -346,8 +344,7 @@ TEST_F(image_resize_test, resize_real_portrait)
346344 int target_width = 200 ;
347345 int target_height = 200 ;
348346
349- auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
350- target_width, target_height);
347+ auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_width, target_height);
351348
352349 // Verify the resized image has reasonable size
353350 EXPECT_GT (resized_image.size (), 0 );
@@ -381,8 +378,7 @@ TEST_F(image_resize_test, resize_real_square_png)
381378
382379 for (int target_size : target_sizes)
383380 {
384- auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
385- target_size, target_size);
381+ auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_size, target_size);
386382
387383 EXPECT_GT (resized_image.size (), 0 ) << " Failed for target size: " << target_size;
388384 EXPECT_EQ (resized_image.size () % orig_channels, 0 ) << " Invalid size for target: " << target_size;
@@ -413,8 +409,7 @@ TEST_F(image_resize_test, extreme_downscaling_real_images)
413409 std::vector<std::uint8_t > tiny_image (target_w * target_h * orig_channels, 0 );
414410
415411 EXPECT_NO_THROW ({
416- tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
417- target_w, target_h, tiny_image);
412+ tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_w, target_h, tiny_image);
418413 }) << " Failed for size: "
419414 << target_w << " x" << target_h;
420415
@@ -450,8 +445,7 @@ TEST_F(image_resize_test, extreme_upscaling_real_images)
450445 int target_width = orig_width * factor;
451446 int target_height = orig_height * factor;
452447
453- auto enlarged_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
454- target_width, target_height);
448+ auto enlarged_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_width, target_height);
455449
456450 EXPECT_GT (enlarged_image.size (), 0 ) << " Failed for scale factor: " << factor;
457451
@@ -492,8 +486,7 @@ TEST_F(image_resize_test, different_aspect_ratios_real_images)
492486
493487 for (const auto & target : targets)
494488 {
495- auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
496- target.width , target.height );
489+ auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target.width , target.height );
497490
498491 EXPECT_GT (resized_image.size (), 0 )
499492 << " Failed for " << target.description << " (" << target.width << " x" << target.height << " )" ;
@@ -525,12 +518,10 @@ TEST_F(image_resize_test, real_image_version_consistency)
525518
526519 // Test void version
527520 std::vector<std::uint8_t > void_result (target_width * target_height * orig_channels, 0 );
528- tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
529- target_width, target_height, void_result);
521+ tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_width, target_height, void_result);
530522
531523 // Test return version
532- auto return_result = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
533- target_width, target_height);
524+ auto return_result = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, target_width, target_height);
534525
535526 // Results should be identical
536527 EXPECT_EQ (void_result.size (), return_result.size ());
@@ -563,8 +554,7 @@ TEST_F(image_resize_test, resize_all_real_images_to_common_size)
563554 auto [original_data, orig_width, orig_height, orig_channels] = tc::img::image_load (image_path);
564555
565556 // Resize to common dimensions
566- auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
567- common_width, common_height);
557+ auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, common_width, common_height);
568558
569559 EXPECT_GT (resized_image.size (), 0 ) << " Failed to resize " << description;
570560 EXPECT_EQ (resized_image.size () % orig_channels, 0 ) << " Invalid size for " << description;
@@ -575,11 +565,6 @@ TEST_F(image_resize_test, resize_all_real_images_to_common_size)
575565
576566 // Should be at least a reasonable fraction of the target size
577567 EXPECT_GE (resized_image.size (), max_expected_size / 4 ) << " Size too small for " << description;
578-
579- // Verify pixel values are valid
580- bool has_valid_pixels = std::all_of (resized_image.begin (), resized_image.end (),
581- [](uint8_t pixel) { return pixel <= 255 ; });
582- EXPECT_TRUE (has_valid_pixels) << " Invalid pixel values in resized " << description;
583568 }
584569}
585570
@@ -614,8 +599,7 @@ TEST_F(image_resize_test, resize_and_save_real_images)
614599 for (const auto & test : resize_tests)
615600 {
616601 // Resize the image
617- auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels,
618- test.width , test.height );
602+ auto resized_image = tc::img::image_resize_aspect_ratio (original_data, orig_width, orig_height, orig_channels, test.width , test.height );
619603
620604 EXPECT_GT (resized_image.size (), 0 ) << " Resize failed for " << test.suffix ;
621605
0 commit comments