1
0
Fork 0
forked from gitea/nas

Change timing to get image size

This commit is contained in:
KMY 2023-03-22 22:50:18 +09:00
parent 2eae1bb9bf
commit 2cdaf2af76
2 changed files with 13 additions and 6 deletions

View file

@ -1,7 +1,5 @@
# frozen_string_literal: true
require 'fastimage'
module Admin
class CustomEmojisController < BaseController
def index
@ -20,11 +18,7 @@ module Admin
def create
authorize :custom_emoji, :create?
image_size = FastImage.size(params[:custom_emoji][:image])
@custom_emoji = CustomEmoji.new(resource_params)
@custom_emoji.image_width = image_size[0]
@custom_emoji.image_height = image_size[1]
if @custom_emoji.save
log_action :create, @custom_emoji