From 6eb43af14135445d93dc63022f4d39d2efa4d686 Mon Sep 17 00:00:00 2001
From: rdinnager <r.dinnage@gmail.com>
Date: Wed, 27 Sep 2023 11:43:31 -0400
Subject: [PATCH] fixes #79, image_height and image_width are reversed (don't
 respect change in get_image_size) for get_random_resized_crop_params() and
 transform_centre_crop.default()

---
 R/transforms-defaults.R | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/R/transforms-defaults.R b/R/transforms-defaults.R
index 0e7e101..f910a2e 100644
--- a/R/transforms-defaults.R
+++ b/R/transforms-defaults.R
@@ -31,8 +31,8 @@ transform_center_crop.default <- function(img, size) {
 
   size <- get_image_size(img)
 
-  image_height <- size[1]
-  image_width <- size[2]
+  image_height <- size[2]
+  image_width <- size[1]
 
   crop_height <- output_size[1]
   crop_width <- output_size[2]
@@ -171,7 +171,7 @@ transform_random_vertical_flip.default <- function(img, p = 0.5) {
 get_random_resized_crop_params <- function(img, scale, ratio) {
 
   img_size <- get_image_size(img)
-  width <- img_size[2]; height <- img_size[1]
+  width <- img_size[1]; height <- img_size[2]
 
   area <- height * width