Skip to content

Instantly share code, notes, and snippets.

View takahashim's full-sized avatar

Masayoshi Takahashi takahashim

View GitHub Profile
Epubcheck Version 1.0.5
ERROR: 20_ipad.epub: length of first filename in archive must be 8, but was 9
ERROR: 20_ipad.epub/OEBPS/Text/cover.xhtml(18): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/pr.xhtml(26): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0002.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0003.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0004.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0006.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0008.xhtml(32): required attributes missing
$ epubcheck 1187_992.epub
Epubcheck Version 1.0.5
ERROR: 1187_992.epub: mimetype contains wrong type (application/epub+zip expected)
ERROR: 1187_992.epub/OEBPS/toc.ncx(21): assertion failed: different playOrder values for navPoint/navTarget/pageTarget that refer to same target
ERROR: 1187_992.epub/OEBPS/toc.ncx(33): assertion failed: different playOrder values for navPoint/navTarget/pageTarget that refer to same target
ERROR: 1187_992.epub/OEBPS/text/cover.xhtml(19): required attributes missing
ERROR: 1187_992.epub/OEBPS/text/003.xhtml(18): required attributes missing
ERROR: 1187_992.epub/OEBPS/text/004.xhtml(18): required attributes missing
ERROR: 1187_992.epub/OEBPS/toc.ncx(25): 'OEBPS/text/chap2.xml': referenced resource missing in the package
diff --git a/test/test_book.rb b/test/test_book.rb
index f93ddf9..d1725d7 100644
--- a/test/test_book.rb
+++ b/test/test_book.rb
@@ -37,29 +37,36 @@ end
class BookTest < Test::Unit::TestCase
include BookTestHelper
+ def assert_same_path(expected, result,*options)
+ require 'pathname'
$ epubcheck epub.epub
Epubcheck Version 1.0.5
ERROR: epub.epub: length of first filename in archive must be 8, but was 31
ERROR: epub.epub/OEBPS/content.opf(8): unfinished element
ERROR: epub.epub/OEBPS/Text/main.xhtml(28): text not allowed here
ERROR: epub.epub/OEBPS/Text/main.xhtml(28): unfinished element
ERROR: epub.epub/OEBPS/Text/main.xhtml(53): unknown element "center" from namespace "http://www.w3.org/1999/xhtml"
ERROR: epub.epub/OEBPS/Text/main.xhtml(55): required attributes missing
ERROR: epub.epub/OEBPS/Text/main.xhtml(57): element "br" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context
$ od -c ../geekpage_jp_blog_2010_8_26_2.epub |head
0000000 P K 003 004 024 \0 \0 \0 \0 \0 \0 \0 \0 \0 L 026
0000020 6 { 362 273 \0 \0 362 273 \0 \0 037 \0 \0 \0 O E
0000040 B P S / i m g / 2 0 1 0 / 0 8 i
0000060 i j / s y s t e m . j p g 377 330 340
0000100 340 \0 020 J F I F \0 001 002 \0 \0 d \0 d \0
0000120 \0 377 354 \0 021 D u c k y \0 001 \0 004 \0 \0
0000140 \0 P \0 \0 377 356 \0 016 A d o b e \0 d 000
0000160 \0 \0 \0 001 377 333 \0 204 \0 002 002 002 002 002 002 002
0000200 002 002 002 003 002 002 002 003 004 003 002 002 003 004 005 004
diff -ur rubyzip-0.9.4.old/lib/zip/stdrubyext.rb rubyzip-0.9.4/lib/zip/stdrubyext.rb
--- rubyzip-0.9.4.old/lib/zip/stdrubyext.rb 2010-09-19 02:24:37.000000000 +0900
+++ rubyzip-0.9.4/lib/zip/stdrubyext.rb 2010-10-06 02:25:00.000000000 +0900
@@ -48,6 +48,10 @@
def lchop
slice(1, length)
end
+
+ if "".respond_to?(:bytesize)
+ alias :bytesize :size
# Sample localization file for Kaminari. You can override these values in your app's locales file if you want.
en:
views:
pagination:
previous: "&laquo; Prev"
next: "Next &raquo;"
truncate: "..."
de:
views:
diff --git a/parseDVI.rb b/parseDVI.rb
index f565746..be390f5 100644
--- a/parseDVI.rb
+++ b/parseDVI.rb
@@ -145,7 +145,7 @@ while c = b.read(1)
when 239..242
s << {name: :xxx,
k: k = readInt(b, c - 238),
- x: b.read(k)}
+ x: b.read(k).force_encoding('euc-jp').encode('utf-8')}
test, test, test.
@takahashim
takahashim / gepub.diff
Created March 11, 2012 07:21
ad hoc patch for gepub
diff --git a/lib/gepub/book.rb b/lib/gepub/book.rb
index eaf2838..56434a1 100644
--- a/lib/gepub/book.rb
+++ b/lib/gepub/book.rb
@@ -242,6 +242,14 @@ module GEPUB
epub.put_next_entry('META-INF/container.xml')
epub << container_xml.force_to_bin
+ ## support com.apple.ibooks.display-options.xml
+ disp_opt_file = "com.apple.ibooks.display-options.xml"