Send to kindleで仕様変更があったようです。
jp.amazonforum.comのKindle無料アプリに関する一般的な質問にある「kindleパーソナルドキュメントのタイトルと著者名が正しく反映されない」を参照してください。
もしかすると英語のフォーラムにはもっと詳しいものがあるかもしれませんが探していません。
挿絵が複数枚ある小説をepubに変換しようとすると途中でエラーが出てしまうのですが、解決する方法は無いのでしょうか?
エラーです↓
java.io.IOException: This archives contains unclosed entries.
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:343)
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:550)
at com.github.hmdev.writer.Epub3Writer.write(Epub3Writer.java:968)
at AozoraEpub3.convertFile(AozoraEpub3.java:512)
at AozoraEpub3.main(AozoraEpub3.java:431)
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/ImageFormatException
at com.sun.media.jai.codecimpl.JPEGImageDecoder.decodeAsRenderedImage(JPEGImageDecoder.java:46)
at com.sun.media.jai.codec.ImageDecoderImpl.decodeAsRenderedImage(ImageDecoderImpl.java:140)
at com.github.hmdev.image.ImageUtils.readImage(ImageUtils.java:107)
at com.github.hmdev.image.ImageUtils.writeImage(ImageUtils.java:152)
at com.github.hmdev.writer.Epub3Writer.writeImage(Epub3Writer.java:1032)
at com.github.hmdev.writer.Epub3Writer.write(Epub3Writer.java:909)
at AozoraEpub3.convertFile(AozoraEpub3.java:512)
at AozoraEpub3.main(AozoraEpub3.java:431)
Caused by: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.ImageFormatException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 8 more
pid 3560 exit 1
以下が試したことです
javaのversion up
元は1.8.0_371より古いものだったと思いますが公式サイトから最新のものをインストールしましたがエラーに変化なし
AozoraEpub3のversion up
元はAozoraEpub3-1.1.0b55QでしたがAozoraEpub3-1.1.1b14Qに変更してもエラーに変化なし
rubyのversion up
元は確か3.1.XだったハズですがアンイントールしてRubyInstallerから最新のものをインストールしましたがエラーに変化なし
Narou.rb のバージョン:3.8.1→3.8.2もエラーに変化なし
AozoraEpub3.jar をクリックして開いたWindowにTxtを直接ドラッグ&ドロップすると、.mobiや.pubは作成出来ます。
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/extension.rb:35:in `write': No such file or directory @ rb_sysopen - D:/winapri/AozoraEpub3-1.1.1b15Q/template/OPS/css_custom/8b1c5cf7decbeb5a2f838a9195b8bd (Errno::ENOENT)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/extension.rb:35:in `write'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/helper.rb:379:in `erb_copy'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/command/init.rb:136:in `block in rewrite_aozoraepub3_files'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/command/init.rb:133:in `times'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/command/init.rb:133:in `rewrite_aozoraepub3_files'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/command/init.rb:106:in `init_aozoraepub3'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/command/init.rb:74:in `execute'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/commandbase.rb:125:in `execute!'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/commandbase.rb:134:in `execute!'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/commandline.rb:29:in `run'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/commandline.rb:43:in `run!'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/narou.rb:50:in `block in <top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/lib/backtracer.rb:16:in `capture'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/narou.rb:49:in `<top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/bin/narou:13:in `require_relative'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/narou-3.8.1/bin/narou:13:in `<top (required)>'
from C:/Ruby31-x64/bin/narou:32:in `load'
from C:/Ruby31-x64/bin/narou:32:in `<main>'
Exception in thread "main" java.lang.UnsupportedClassVersionError: AozoraEpub3 has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
pid 13928 exit 1
[ERROR] JavaがインストールされていないかAozoraEpub3実行時にエラーが発生しました。EPUBを作成出来ませんでした
小説の保存フォルダを開きますか (y/n)?:
/Users/ユーザー名/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/narou-3.8.2/narou.rb:10:in `require_relative': cannot load such file -- /Users/ユーザー名/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/narou-3.8.2/lib/extension (LoadError)
from /Users/ユーザー名/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/narou-3.8.2/narou.rb:10:in `<top (required)>'
from /Users/ユーザー名/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/narou-3.8.2/bin/narou:13:in `require_relative'
from /Users/ユーザー名/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/narou-3.8.2/bin/narou:13:in `<top (required)>'
from /Users/ユーザー名/.rbenv/versions/3.3.0/bin/narou:25:in `load'
from /Users/ユーザー名/.rbenv/versions/3.3.0/bin/narou:25:in `<main>'
gem which narou をためすと、
ERROR: Can't find Ruby library file or shared library narou
と出ます。
以下、gem install narou
をした時のエラー表示
_______
c:\>gem install narou
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing narou:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sassc-2.4.0/ext
C:/Ruby32-x64/bin/ruby.exe extconf.rb
creating Makefile
current directory: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sassc-2.4.0/ext
make DESTDIR\= sitearchdir\=./.gem.20240406-8836-13mkuh sitelibdir\=./.gem.20240406-8836-13mkuh clean
current directory: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sassc-2.4.0/ext
make DESTDIR\= sitearchdir\=./.gem.20240406-8836-13mkuh sitelibdir\=./.gem.20240406-8836-13mkuh
compiling ./libsass/src/ast.cpp
make: g++: コマンドが見つかりませんでした
make: *** [Makefile:240: ast.o] エラー 127
make failed, exit code 2
Gem files will remain installed in C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/sassc-2.4.0 for inspection.
Results logged to C:/Ruby32-x64/lib/ruby/gems/3.2.0/extensions/x64-mingw-ucrt/3.2.0/sassc-2.4.0/gem_make.out
Narou.rb のバージョン:
Version 3.9.0
OS のバージョン:Windows11
何が起きたのか:
再現方法(何をやったら起こったのか詳細に):
小説家になろうからのダウンロードの際、100話前後の作品は問題無くテキストとEPUBが生成されるのですが、300話など長い作品の場合、テキストは生成されるものの、EPUB生成に失敗してしまいます。エラーメッセージを添付します。
--------
変換開始 : D:\narounovel\小説データ\小説家になろう\n7259z 双色の錬金術師\[ちゅるぎ] 双色の錬金術師.txt
[INFO] 濁点フォント利用 (17741) : ん゛
[INFO] 濁点フォント利用 (65560) : あ゛
[INFO] 濁点フォント利用 (65560) : ぁ゛
[INFO] 濁点フォント利用 (65560) : ぃ゛
[INFO] 濁点フォント利用 (76855) : あ゛
[INFO] 濁点フォント利用 (79905) : あ゛
java.io.IOException: This archives contains unclosed entries.
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:343)
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:550)
at com.github.hmdev.writer.Epub3Writer.write(Epub3Writer.java:968)
at AozoraEpub3.convertFile(AozoraEpub3.java:512)
at AozoraEpub3.main(AozoraEpub3.java:431)
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/ImageFormatException
at com.sun.media.jai.codecimpl.JPEGImageDecoder.decodeAsRenderedImage(JPEGImageDecoder.java:46)
at com.sun.media.jai.codec.ImageDecoderImpl.decodeAsRenderedImage(ImageDecoderImpl.java:140)
at com.github.hmdev.image.ImageUtils.readImage(ImageUtils.java:107)
at com.github.hmdev.image.ImageUtils.writeImage(ImageUtils.java:152)
at com.github.hmdev.writer.Epub3Writer.writeImage(Epub3Writer.java:1032)
at com.github.hmdev.writer.Epub3Writer.write(Epub3Writer.java:909)
at AozoraEpub3.convertFile(AozoraEpub3.java:512)
at AozoraEpub3.main(AozoraEpub3.java:431)
Caused by: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.ImageFormatException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 8 more
pid 29992 exit 1
[ERROR] JavaがインストールされていないかAozoraEpub3実行時にエラーが発生しました。EPUBを作成出来ませんでした