View Full Version : Problems with pictures in Mobi Files


NASCARaddicted
06-15-2009, 02:19 PM
Right now I have a problem with pictures in ebooks on my Bebook:

I scanned 2 books and used an OCR software. In the end, I saved them both as htm files with a few jpg pictures. Some of the jpg files have been bigger then 800x600 (the screen resolution of my Bebook is 800x600) others have been resized to something like 800x500 or 700x600, depending on the original size.

After that, I converted the htm files to mobi files, with the free software "Calibre". Also I told Calibre to include a cover image.Now, if I look at the preview in Calibre, the pictures are there - if I put them on my Bebook, they are missing. However, the cover image is working fine.

As an example: On the top half of the page, there is text, the lower half is empty. That is ok, since the jpeg file is larger then remaining free part. But when I turn a page follow, there is no picture. Instead, the text just continues.

I use the normal img src="name.jpg" command. Can anyone tell me what I am doing wrong ?

Nate the great
06-15-2009, 02:28 PM
There is an upper limit for images in Mobipocket files. It looks like you crossed it.

P.S. Calibre doesn't use Mobipocket's code, but Bebook does. That's why it works in one but not the other.

tompe
06-15-2009, 02:52 PM
There is an upper limit for images in Mobipocket files. It looks like you crossed it.


It has not been confirmed that any E-ink-reader care about the image size (in bytes) limitation. So it would be interesting to confirm if this is the issue or not. mobi2mobi in MobiPerl can be used to rescale the images to test this.

Nate the great
06-15-2009, 02:55 PM
It has not been confirmed that any E-ink-reader care about the image size (in bytes) limitation. So it would be interesting to confirm if this is the issue or not. mobi2mobi in MobiPerl can be used to rescale the images to test this.

Yes it has been confirmed. This has come up before, as related to the K2. In that instance the files were quite large (I think 1400x2400).

tompe
06-15-2009, 02:58 PM
Yes it has been confirmed. This has come up before, as related to the K2. In that instance the files were quite large (I think 1400x2400).

Are you talking image size in bytes here or something else. Have somebody collected this information somewhere? When people wanted me to allow larger images (in bytes) in MobiPerl they claimed that newer readers did not have any limitation (of course it has some limitation but 1400x2400 seems pretty small to be such a limitation).

Nate the great
06-15-2009, 03:03 PM
Are you talking image size in bytes here or something else. Have somebody collected this information somewhere? When people wanted me to allow larger images (in bytes) in MobiPerl they claimed that newer readers did not have any limitation (of course it has some limitation but 1400x2400 seems pretty small to be such a limitation).

According to Mobipocket, the upper limit is 63KB.
http://www.mobipocket.com/dev/article.asp?BaseFolder=prcgen&File=images.htm#img

tompe
06-15-2009, 03:18 PM
According to Mobipocket, the upper limit is 63KB.
http://www.mobipocket.com/dev/article.asp?BaseFolder=prcgen&File=images.htm#img

Yes, I know. But that restriction only seems to be important on old Palm devices. So I recently let me be persuaded not to enforce that limit in MobiPerl. But if there in practice are some other limit I would very much want to know what they are.

Nate the great
06-15-2009, 03:38 PM
Yes, I know. But that restriction only seems to be important on old Palm devices. So I recently let me be persuaded not to enforce that limit in MobiPerl. But if there in practice are some other limit I would very much want to know what they are.

Let's settle this, then. Make an ebook with MobiPerl that breaks the image size limit. I'll test it on my devices.

SO far as I know, the image size limit applies to MobiDesktop as well.

tompe
06-15-2009, 03:52 PM
Let's settle this, then. Make an ebook with MobiPerl that breaks the image size limit. I'll test it on my devices.

SO far as I know, the image size limit applies to MobiDesktop as well.

Well, here is a file were one image is 217520 bytes.

Nate the great
06-15-2009, 03:56 PM
Where is the first big image?

Nate the great
06-15-2009, 04:13 PM
Where is the first big image?

Nevermind. The same images all show up in both Calibre and MobiDesktop. But i can't see them on my Airpanel (which runs MobiReader 4.8).

tompe
06-15-2009, 04:13 PM
Where is the first big image?

It is the cover image (which is included twice so it is shown also in readers that do not support cover images).

Here is the same file but with a 2M cover image and larger format (6000x8000 jpg image).

Nate the great
06-15-2009, 04:16 PM
It is the cover image (which is included twice so it is shown also in readers that do not support cover images).

Here is the same file but with a 2M cover image and larger format (6000x8000 jpg image).

I can see the cover. I just can't see any of the later images. I wonder why?

Sweetpea
06-16-2009, 05:29 AM
First, I do see the images, but not the cover on my reader: Mobipocket Reader v.5.3 - Build 582.

But:

I took the mobi file from your second post and parsed it through my scripts. I can see the images. (after getting the HTML using mobi2oeb)

I did have to make some changes, as I make sure my source files are epub compliant:

1. changed the order of the <guide> and <spine> in the .opf file
2. added the ncx file to the manifest in the .opf file
3. added the <?xml version?>, doctype and html xmlns to the HTML file

step 2 required me to make some minor changes to the file:
4. <font> isn't allowed, <a name> isn't allowed, <center> isn't allowed. I replaced those with a <span class="font-size">, <a id> and <div class="center">.
5. an image requires the "alt" attribute, so I added an alt="image" to all images
6. I had to add an extra <div> in the table of contents, as the <a> and <br/>'s aren't valid in a blockquote (apparently)
7. there are two loose <a> elements, I had to surround them in a <div> also.

My script makes an epub file from the sources, and then uses mobigen to create a mobi file.

The result does show all images and the cover.

----

The changes I made to the HTML file and the OPF file won't explain why they do show for me. But, the way I transform them does. I've no idea how to use Calibre to make mobi files, otherwise I'd use those sources and try to see what Calibre does...

tompe
06-16-2009, 08:57 AM
mobigen will scale the images.

I must remember to test the files on my Cybook also. I just tested them with FBreader and they worked there but FBReader was not so good in handling the large image.

Sweetpea
06-16-2009, 10:04 AM
But that doesn't explain why I do see those smaller images and Nate doesn't...

tompe
06-16-2009, 05:44 PM
Here is the same file but with a 2M cover image and larger format (6000x8000 jpg image).

That file rebooted my Cybook... The other file worked.