Fix ugoira thumbs not being scaled down to 150x150

This commit is contained in:
Toks
2014-10-17 11:29:50 -04:00
committed by r888888888
parent 029f0eff06
commit 230a5ad37e

View File

@@ -45,9 +45,11 @@ class PixivUgoiraConverter
end
def write_preview(folder, path)
file = folder.first
image_blob = file.get_input_stream {|is| is.read}
image = Magick::Image.from_blob(image_blob).first
image.write(path)
Dir.mktmpdir do |tmpdir|
file = folder.first
temp_path = File.join(tmpdir, file.name)
file.extract(temp_path)
Danbooru.resize(temp_path, path, Danbooru.config.small_image_width, Danbooru.config.small_image_width, 85)
end
end
end