Skip to content

Commit 91f0941

Browse files
authored
Update 4-AI_image_multimodal_location_GPT.R
1 parent 893d462 commit 91f0941

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

4-AI_image_multimodal_location_GPT.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ img <- load.image(image_path)
130130

131131
# Get the image dimensions
132132
info <- image_info(magick::image_read(file.path(image_path)))
133-
# Check if the image is vertical
134-
if (info$height > info$width) {
133+
# Check if the image is horizontal
134+
if (info$width > info$height) {
135135
# Rotate the image by 90 degrees clockwise
136-
img_rotated <- imrotate(img, -90)
136+
img_rotated <- imrotate(img, 90)
137137
} else {
138138
# Keep the image as it is
139139
img_rotated <- img
140140
}
141-
plot(img)
141+
plot(img_rotated) ## All my photos for social media are on the vertical position, but change this to "img" if you don't want to see your photos always plotted that way
142142

143143
# read the local image file as raw bytes, reducing to 4Mb (if needed) which is Azure's max limit
144144
if (file.size(image_path)>4150000){

0 commit comments

Comments
 (0)