Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 07:13 PM   #1
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 53,119
Karma: 181177243
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Issue with large PNG image

I edited an ePub for my spouse today and thee was a rather large .png image which Sigil's image viewer refused to open when I double-clicked on it. Using the View Image option allowed me to see the image with the size reported as 0x0 pixels. But doesn't everybody use a 4671x15231 pixel image for a chapter header?
Attached Files
File Type: epub image_issue.epub (1.54 MB, 3 views)
DNSB is offline   Reply With Quote
Old Yesterday, 10:43 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,794
Karma: 7500000
Join Date: Nov 2009
Device: many
Thanks for the test case. I will try to pass that image through a png validator to make sure it is not corrupt. If it is valid, I will try to figure out why Qt QImage (what Sigil's Image Tab uses) can not read it but View Image (QtWebEngine) can?
KevinH is online now   Reply With Quote
Old Today, 01:00 AM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 53,119
Karma: 181177243
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what it may be worth, I checked the dagger.png file using PNGCheck 4.01 and it seemed happy.

D:\tester\>pngcheck -v dagger.png
File: dagger.png (1930112 bytes)
chunk IHDR at offset 0x0000c, length 13
4671 x 15231 image, 32-bit RGB+alpha, non-interlaced
chunk pHYs at offset 0x00025, length 9: 11811x11811 pixels/meter (300 dpi)
chunk iTXt at offset 0x0003a, length 1481, keyword: XML:com.adobe.xmp
uncompressed, no language tag
no translated keyword, 1460 bytes of UTF-8 text
chunk IDAT at offset 0x0060f, length 1048576
zlib: deflated, 32K window, default compression
chunk IDAT at offset 0x10061b, length 879953
chunk IEND at offset 0x1d7378, length 0
No errors detected in dagger.png (6 chunks, 99.3% compression).
DNSB is offline   Reply With Quote
Old Today, 08:50 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,794
Karma: 7500000
Join Date: Nov 2009
Device: many
Actually, I get a nice error message from MacOS or Qt that says the following:

Quote:
Cannot load /Users/kbhend/Library/ Application Support/sigil-ebook/sigil/ workspace/Sigil-kORsSx/OEBPS/Images/ daggerL.png.
You can see the nice error message in my screenshot attached below.

Do you get the same error message box?

So this image breaks some limit internal to Qt QImages.

I will see if there is any way to relax that limit.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2026-07-16 at 8.44.51 AM.png
Views:	3
Size:	96.0 KB
ID:	224460  
KevinH is online now   Reply With Quote
Old Today, 09:05 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,794
Karma: 7500000
Join Date: Nov 2009
Device: many
And the issue is QImage converts all images to 32 bpp to enable the highest quality editing. This image should have been at 8bpp but QImage makes it a 32 bpp on load. There is no way to change that until after loading so this is a catch-22.

So 1 byte vs 4 bytes per pixel change. So if this image is loaded in a QImage this image is at least 4 times bigger than the approximately 2 megabyte (or more once uncompressed) current file size!

And of course, there is also an allocation limit internal to QImage, but there is an environment variable to change it.

QT_IMAGEIO_MAXALLOC

This is supposed to be in "megabytes" but I have no idea. So you might want try setting this env variable to 320.

Does that allow this image to seen/edited in its Tab?


Update: I checked this and its value is in megabytes and in Qt master this is set to:

https://github.com/qt/qtbase/blob/ac...eader.cpp#L435


256 MB.

And 4671 x 15231 image, 32-bit (4 bytes per pixel) = 284576004 bytes which exceeds that limit.

Setting that environment var to 0 should disable the maximum limit according to the Qt source.

But that is just such a stupid size (4671 x 15231) for an epub image!

Not sure there is anything we on Sigil's end should do, here.

Last edited by KevinH; Today at 10:05 AM.
KevinH is online now   Reply With Quote
Old Today, 10:19 AM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,794
Karma: 7500000
Join Date: Nov 2009
Device: many
Tested setting that env var to 320 and sure enough Sigil's Image Tab was able to load and edit it.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with large png image Liudprand Conversion 6 03-08-2023 01:40 PM
Koreader Png issue Emix83 KOReader 7 11-29-2022 11:18 PM
svg image on top of a background png image roger64 ePub 25 04-24-2015 11:00 AM
Display of a png image linked to a svg image roger64 Editor 6 03-13-2015 06:21 AM
hotlinking png image bobcdy Sigil 21 09-21-2010 04:56 AM


All times are GMT -4. The time now is 10:30 AM.


MobileRead.com is a privately owned, operated and funded community.