Fix custom emoji re-rect in object storage
This commit is contained in:
parent
ae1479f913
commit
271ac6cd96
1 changed files with 4 additions and 4 deletions
|
@ -77,7 +77,7 @@ class CustomEmoji < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_size
|
def update_size
|
||||||
set_size(image)
|
set_size(Rails.configuration.x.use_s3 ? image.url : image.path)
|
||||||
end
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
@ -109,13 +109,13 @@ class CustomEmoji < ApplicationRecord
|
||||||
def set_post_size
|
def set_post_size
|
||||||
image.queued_for_write.each do |style, file|
|
image.queued_for_write.each do |style, file|
|
||||||
if style == :original
|
if style == :original
|
||||||
set_size(file)
|
set_size(file.path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_size(file)
|
def set_size(path)
|
||||||
image_size = FastImage.size(file.path)
|
image_size = FastImage.size(path)
|
||||||
self.image_width = image_size[0]
|
self.image_width = image_size[0]
|
||||||
self.image_height = image_size[1]
|
self.image_height = image_size[1]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue