integrate ugoiras into zip+webm+preview

This commit is contained in:
r888888888
2014-10-09 17:05:47 -07:00
parent 0a61aac231
commit 3bb06c2be4
28 changed files with 1800 additions and 1125 deletions

View File

@@ -0,0 +1,21 @@
class PixivUgoiraService
attr_reader :width, :height, :frame_data
def process(post)
save_frame_data(post)
end
def save_frame_data(post)
PixivUgoiraFrameData.create(:data => @frame_data, :post_id => post.id)
end
def generate_resizes(source_path, output_path, preview_path)
PixivUgoiraConverter.new.convert(source_path, output_path, preview_path, @frame_data)
end
def load(data)
@frame_data = data[:ugoira_frame_data]
@width = data[:ugoira_width]
@height = data[:ugoira_height]
end
end