mirror of
https://github.com/neocities/neocities.git
synced 2025-07-24 03:20:40 +02:00
code to delete thumbnails and screenshots
This commit is contained in:
parent
b0e1a47e19
commit
0a636b2397
3 changed files with 44 additions and 8 deletions
|
@ -1,7 +1,6 @@
|
|||
require 'RMagick'
|
||||
|
||||
class ThumbnailWorker
|
||||
REQUIRED_RESOLUTIONS = ['105x63']
|
||||
THUMBNAILS_PATH = File.join DIR_ROOT, 'public', 'site_thumbnails'
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options queue: :thumbnails, retry: 3, backtrace: true
|
||||
|
@ -14,7 +13,7 @@ class ThumbnailWorker
|
|||
user_thumbnails_path = File.join THUMBNAILS_PATH, username
|
||||
FileUtils.mkdir_p user_thumbnails_path
|
||||
|
||||
REQUIRED_RESOLUTIONS.each do |res|
|
||||
Site::THUMBNAIL_RESOLUTIONS.each do |res|
|
||||
resimg = img.resize_to_fit(*res.split('x').collect {|r| r.to_i})
|
||||
format = File.extname(filename).gsub('.', '')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue