Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2017, 07:07 PM   #1
Cyberseeker
Connoisseur
Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.
 
Posts: 60
Karma: 602194
Join Date: Apr 2017
Device: Ipad
Image Width in Contents Pane

I would like svg images included in my book to utilise the maximum screen space of whatever device the reader is using, so my stylesheet says,
Code:
	div.image {
width:100%; margin:2em auto; text-align:center;
}
	img       {
max-width:100%; max-height:100%
}
Sigil's contents pane shows text at full width, but inserted images are rendered at about 75%. I asked about this up in the Epub forum and also at Inkscape, but I think it must be a Sigil issue.

Has anyone encountered this problem, and if so, can I get a fix please?
Cyberseeker is offline   Reply With Quote
Old 05-17-2017, 03:00 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
It is not an Sigil issue. The best way to use the maximum screen space is to use a wrapper. The code for that is also used for covers in Sigil. That is the same answer you got in the ePUB forum.

Also, you have a margin specified for the div containing the image, so the complete screen will never be used. That is even besides the potential margin for the body and html tags.

Another point, the auto value does not really work for a lot of readers It will be interpreted as being 0 (this in accordance to the ePUB specifications).
Toxaris is offline   Reply With Quote
Old 05-17-2017, 09:34 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Toxaris View Post

Another point, the auto value does not really work for a lot of readers It will be interpreted as being 0 (this in accordance to the ePUB specifications).
That is true - the fix is to combine it with text-align:center to catch all those pesky 'substandard' readers.
Turtle91 is offline   Reply With Quote
Old 05-17-2017, 01:43 PM   #4
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
You may wish to try my plugin that wraps images in SVG code. It is available at:

https://www.mobileread.com/forums/sh...d.php?t=283333
CalibUser is offline   Reply With Quote
Old 05-17-2017, 10:56 PM   #5
Cyberseeker
Connoisseur
Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.
 
Posts: 60
Karma: 602194
Join Date: Apr 2017
Device: Ipad
Quote:
Originally Posted by CalibUser View Post
You may wish to try my plugin that wraps images in SVG code. It is available at:

https://www.mobileread.com/forums/sh...d.php?t=283333
Im giving it a whirl now. Looks good, but there seem to be a few glitches. The 2 buttons, 'Import external image' and 'Default folder' both point to the same place.

Then, when I select one of my svg images 'Select image window' I get a popup saying, "You must select an image from the list, or load a file."

Last edited by Cyberseeker; 05-17-2017 at 11:08 PM.
Cyberseeker is offline   Reply With Quote
Old 05-18-2017, 03:05 PM   #6
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by Cyberseeker View Post
The 2 buttons, 'Import external image' and 'Default folder' both point to the same place.
This is intentional: The 'Import external image' button will open a browser dialog that opens at the folder set by the 'Default folder' option. You can change the default folder by clicking the 'Default folder' button and selecting a different folder that contains your images. Then, when you click 'Import external image' the image folder that you set as a default will open. Perhaps I did not make this clear enough in the ePub instructions. Clicking the 'Default folder' button will not let you select an image.

Quote:
Originally Posted by Cyberseeker View Post
Then, when I select one of my svg images 'Select image window' I get a popup saying, "You must select an image from the list, or load a file."
The plugin will not import a SVG image (the plugin uses the Pillow module and unfortunately this does not support SVG files). However, you can select eg a png file and when you import this it will be wrapped in a SVG wrapper.

There is an issue with double clicking the selected file in the dialog box 'Choose an image file': if the mouse is double-clicked on an image filename in this dialog and the mouse is over the 'Select image' listbox of the ''Insert Image into ebook with SVG wrapping' window then the second click seems to go through to the listbox; if the listbox in this region is empty, then a file is not selected and you get the message "You must select an image from the list, or load a file.".

To overcome this problem, instead of double clicking an image file to select it in the 'Choose an image file' dialog, click the image file once to highlight it and then click the 'Open' button in this dialog and this should open your image.

I have not been able to resolve this issue so far; I may have to change the code so that a single click opens the image file, but I would prefer to find an alternative solution as a double click is the standard way to open a file. I hope the above helps in the meantime.
CalibUser is offline   Reply With Quote
Old 05-18-2017, 03:17 PM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by CalibUser View Post
The plugin will not import a SVG image (the plugin uses the Pillow module and unfortunately this does not support SVG files). However, you can select eg a png file and when you import this it will be wrapped in a SVG wrapper.
That is a shame, since svg is a perfectly acceptable format for images in an ePUB.
Toxaris is offline   Reply With Quote
Old 05-18-2017, 04:29 PM   #8
Cyberseeker
Connoisseur
Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.
 
Posts: 60
Karma: 602194
Join Date: Apr 2017
Device: Ipad
Quote:
Originally Posted by CalibUser
The plugin will not import a SVG image (the plugin uses the Pillow module and unfortunately this does not support SVG files). However, you can select eg a png file and when you import this it will be wrapped in a SVG wrapper.
Perhaps svg files will be supported in the future. In the meanwhile, I tried jpeg and png and it looked good. One question however; what advantage is it to wrap a different file-type image in a svg wrapper? Im not a techie so it seems strange to me. Does it enhance the png image?
Cyberseeker is offline   Reply With Quote
Old 05-18-2017, 05:09 PM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
No, but it will scale to any screen resolution utilizing the whole screen. When set correctly, it keep the aspect ratio.
Toxaris is offline   Reply With Quote
Old 05-18-2017, 07:31 PM   #10
Cyberseeker
Connoisseur
Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.
 
Posts: 60
Karma: 602194
Join Date: Apr 2017
Device: Ipad
Scaling to any screen resolution sounds like a good idea. But as I understand it, pixel based images degrade when scaled, whereas svg images do not. Is this an issue with CalibUser's plugin?
Cyberseeker is offline   Reply With Quote
Old 05-18-2017, 09:59 PM   #11
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
You can also manually import the svg file, then use the same technique, and code, to put the SVG wrapper around it. See the other thread you had on this topic.
Turtle91 is offline   Reply With Quote
Old 05-19-2017, 02:21 PM   #12
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by Cyberseeker View Post
Scaling to any screen resolution sounds like a good idea. But as I understand it, pixel based images degrade when scaled, whereas svg images do not. Is this an issue with CalibUser's plugin?
The plugin imports images that use standard formats, eg png, and scales them to the size of the display screen for the ePub reader (retaining the aspect ratio), so if the original size of the image is significantly different to the height/width of the displayed image then some degradation is possible.
CalibUser is offline   Reply With Quote
Old 05-19-2017, 03:59 PM   #13
Cyberseeker
Connoisseur
Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.Cyberseeker ought to be getting tired of karma fortunes by now.
 
Posts: 60
Karma: 602194
Join Date: Apr 2017
Device: Ipad
Quote:
Originally Posted by CalibUser View Post
The plugin imports images that use standard formats, eg png, and scales them to the size of the display screen for the ePub reader (retaining the aspect ratio), so if the original size of the image is significantly different to the height/width of the displayed image then some degradation is possible.
Thanks for replying. My book uses a lot of long diagrams, so I like your plugin and will use it for larger png's. I hope it develops in time to include svg files as well.

Last edited by Cyberseeker; 05-19-2017 at 04:06 PM.
Cyberseeker is offline   Reply With Quote
Old 05-21-2017, 09:24 AM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
PIL/Pillow doesn't support SVG. But an SVG file is just XML, so it wouldn't be impossible to "detect" an SVG file using lxml or gumbo and extract its dimensions/viewPort. You'd have to intercept the SVG before passing the image data to PIL, but it would be possible to support SVG images with the Image Wrapper plugin. What doesn't pass the SVG sniff test could then be passed on to Pillow. Just a suggestion, mind you.
DiapDealer is offline   Reply With Quote
Old 05-23-2017, 02:29 PM   #15
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by DiapDealer View Post
...an SVG file is just XML, so it wouldn't be impossible to "detect" an SVG file using lxml or gumbo and extract its dimensions/viewPort. You'd have to intercept the SVG before passing the image data to PIL, but it would be possible to support SVG images with the Image Wrapper plugin. What doesn't pass the SVG sniff test could then be passed on to Pillow. Just a suggestion, mind you.
Thanks for this suggestion. It is something I may look into as a project for the future as I have not used SVG images, lxml or gumbo so I will need to get my head around these when I get time....
CalibUser is offline   Reply With Quote
Reply

Tags
image, svg, width

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Maximize Image Width Cyberseeker ePub 19 06-07-2017 02:53 PM
fit a image to the width of screen leescott ePub 7 07-23-2015 10:39 AM
Changing image width in the economist goios Recipes 1 04-24-2014 01:29 PM
problem with floating image and relative width jobalcaen ePub 5 08-17-2013 07:53 AM
Setting Image width on news feed Wiggles Calibre 2 08-13-2010 02:10 AM


All times are GMT -4. The time now is 10:12 PM.


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