Skip to content

Commit 004e0a1

Browse files
committed
fix derivative enabled check
1 parent 903a7b1 commit 004e0a1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/uploaders/application_uploader.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@ def generate_location(io, record: nil, derivative: nil, metadata: {}, **)
122122
carousel: magick.resize_to_limit!(1024, 768)
123123
}
124124
end
125+
elsif SupportedMimeTypes.can_render?(context[:record].mime_type)
126+
Shrine.with_file(original) do |it|
127+
up = context[:record]&.up_direction
128+
render = StringIO.new(`f3d #{it.path} #{F3D_OPTS} --up=#{up} --camera-direction=#{CAMERA_OPTS[up]}`)
129+
{
130+
render: (render.length > 0) ? render : nil
131+
}.compact
132+
end
125133
else
126134
{}
127135
end
128-
elsif SupportedMimeTypes.can_render?(context[:record].mime_type)
129-
Shrine.with_file(original) do |it|
130-
up = context[:record]&.up_direction
131-
render = StringIO.new(`f3d #{it.path} #{F3D_OPTS} --up=#{up} --camera-direction=#{CAMERA_OPTS[up]}`)
132-
{
133-
render: (render.length > 0) ? render : nil
134-
}.compact
135-
end
136136
else
137137
{}
138138
end

0 commit comments

Comments
 (0)