adjust autorot

This commit is contained in:
Pete Matsyburka
2026-05-23 09:30:56 +03:00
parent d44b35cf0a
commit 89bf83febb
5 changed files with 16 additions and 12 deletions
+4 -2
View File
@@ -6,7 +6,7 @@ module ImageUtils
module_function
def load_vips(data, content_type: nil)
def load_vips(data, content_type: nil, autorot: false)
content_type ||= Marcel::MimeType.for(data)
if ICO_REGEXP.match?(content_type)
@@ -14,7 +14,9 @@ module ImageUtils
elsif BMP_REGEXP.match?(content_type)
LoadBmp.call(data)
else
Vips::Image.new_from_buffer(data, '')
image = Vips::Image.new_from_buffer(data, '')
autorot ? image.autorot : image
end
end