Remove tempfile created by minimagick.

This commit is contained in:
邱博亞 2025-05-20 22:51:29 +08:00
parent 8850d99824
commit 2bbbb4f5af
1 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class PageContentsController < OrbitAdminController
if image[:height]
metas << {"property" => "og:image:height", "content" => image[:height].to_s}
end
image.destroy! # Remove the tempfile
end
end
else
@ -59,6 +60,7 @@ class PageContentsController < OrbitAdminController
metas << {"property" => "og:image:height", "content" => image[:height].to_s}
end
image_file.unlink
image.destroy! # Remove the tempfile
rescue MiniMagick::Invalid => e
puts ["src = #{img_src}", e.to_s]
end