Simplify zip extracting code
This commit is contained in:
@@ -10,10 +10,7 @@ class PixivUgoiraConverter
|
|||||||
FileUtils.mkdir_p("#{tmpdir}/images")
|
FileUtils.mkdir_p("#{tmpdir}/images")
|
||||||
folder.each_with_index do |file, i|
|
folder.each_with_index do |file, i|
|
||||||
path = File.join(tmpdir, "images", file.name)
|
path = File.join(tmpdir, "images", file.name)
|
||||||
image_blob = file.get_input_stream {|is| is.read}
|
file.extract(path)
|
||||||
File.open(path, "wb") do |f|
|
|
||||||
f.write(image_blob)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Duplicate last frame to avoid it being displayed only for a very short amount of time.
|
# Duplicate last frame to avoid it being displayed only for a very short amount of time.
|
||||||
|
|||||||
Reference in New Issue
Block a user