【问题标题】:get cover image of *.mobi or *.prc files获取 *.mobi 或 *.prc 文件的封面图片
【发布时间】:2012-08-03 10:58:25
【问题描述】:

我正在尝试解析移动图书,只想获取图书的一些信息,即:标题、作者和封面(如果有)。我正在关注mobi format spec

现在,我可以正确获取标题和作者,但是当涉及到封面时,我到目前为止得到了这些信息:

  1. 我得到图像记录块索引:

     108  0x6c    4   First Image index   First record number (starting with 0) that contains an image. Image records should be sequential.
    
  2. 我得到从开始到图像记录的偏移量

  3. 我试图获取这些字段,但我没有从我的任何书籍中获取它们:
EXTH
 201  4   coveroffset  Add to first image field in Mobi Header to find PDB record containing the cover image  <EmbeddedCover>
    202   4   thumboffset  Add to first image field in Mobi Header to find PDB record containing the thumbnail cover image    
    203       hasfakecover

所以,现在我得到了一个原始二进制块,我将它与其他 png 文件和 jpg 文件进行了比较,没有发现任何共同点。我还尝试将这个二进制块保存到 test.png 或 test.jpg,但它似乎不是真实的图像。

我该怎么办?

【问题讨论】:

    标签: kindle mobipocket


    【解决方案1】:

    我可以完美地将我的第一个 image_record_block 保存为 jpg。而且因为它们是压缩图像,所以不会受到 mobi 或 palmdoc 压缩。您应该在文本编辑器中打开原始文件,看看这是否真的是任何图像格式。这可能是您希望索引号错误或文件指针不在正确的偏移量中,请尝试使用 fseek()

    【讨论】:

      猜你喜欢
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-15
      • 1970-01-01
      • 2015-03-20
      相关资源
      最近更新 更多