Fix error reading zip

This commit is contained in:
Toks
2014-10-17 00:20:24 -04:00
committed by r888888888
parent 4ab58e841e
commit d05311a3eb

View File

@@ -1,6 +1,6 @@
class PixivUgoiraConverter
def convert(source_path, output_path, preview_path, frame_data)
folder = unpack(File.open(source_path))
folder = Zip::File.new(source_path)
write_webm(folder, output_path, frame_data)
write_preview(folder, preview_path)
end
@@ -50,10 +50,4 @@ class PixivUgoiraConverter
image = Magick::Image.from_blob(image_blob).first
image.write(path)
end
def unpack(zip_file)
folder = Zip::CentralDirectory.new
folder.read_from_stream(zip_file)
folder
end
end