Leeingnyo
2020-03-13 02:22:12 +09:00
parent db6d33eae1
commit d120433525
2 changed files with 49 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ require "zip"
require "mime"
require "json"
require "uri"
require "./util"
struct Image
property data : Bytes
@@ -44,7 +45,7 @@ class Entry
["image/jpeg", "image/png"].includes? \
MIME.from_filename? e.filename
}
.sort { |a, b| a.filename <=> b.filename }
.sort { |a, b| compare_alphanumerically(split_by_alphanumeric(a.filename), split_by_alphanumeric(b.filename)) }
.[page_num - 1]
page.open do |io|
slice = Bytes.new page.uncompressed_size