mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
screenshot_worker: fixes weird chmod permissions error with mount
This commit is contained in:
parent
dd40671576
commit
395ae6b4f9
1 changed files with 10 additions and 6 deletions
|
@ -64,13 +64,16 @@ class ScreenshotWorker
|
|||
end
|
||||
|
||||
full_screenshot_path = File.join(user_screenshots_path, "#{path}.#{res}.jpg")
|
||||
tmpfile_path = "/tmp/#{SecureRandom.uuid}.jpg"
|
||||
|
||||
new_img.write(full_screenshot_path) {
|
||||
self.quality = 90
|
||||
}
|
||||
|
||||
new_img.destroy!
|
||||
$image_optim.optimize_image! full_screenshot_path
|
||||
begin
|
||||
new_img.write(tmpfile_path) { self.quality = 90 }
|
||||
new_img.destroy!
|
||||
$image_optim.optimize_image! tmpfile_path
|
||||
File.open(full_screenshot_path, 'wb') {|file| file.write File.read(tmpfile_path)}
|
||||
ensure
|
||||
FileUtils.rm tmpfile_path
|
||||
end
|
||||
end
|
||||
|
||||
img.destroy!
|
||||
|
@ -106,3 +109,4 @@ class ScreenshotWorker
|
|||
=end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue