From 8467fd9e51ee0591be283805c11ea770025be906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Tue, 20 May 2025 23:26:21 +0800 Subject: [PATCH] Remove tempfile created by minimagick. --- app/controllers/announcements_controller.rb | 1 + app/models/bulletin.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 76c2abd..5d320e3 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -760,6 +760,7 @@ class AnnouncementsController < ApplicationController if image[:height] metas << {"property" => "og:image:height", "content" => image[:height].to_s} end + image.destroy! # Remove the tempfile end end OrbitHelper.render_meta_tags(metas) diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index 92ffd32..2a7c99c 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -416,6 +416,7 @@ class Bulletin if image a["image"]["width"] = image[:width] a["image"]["height"] = image[:height] + image.destroy! # Remove the tempfile end end a["tags"] = []