Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2016, 04:04 PM   #1
david_f1
Junior Member
david_f1 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2016
Device: Nook
image url looking in temp folder for file

Hi,

I'm modifying the CSS file of an epub I've created to have a background image:

Code:
h1:before {
    background-image: url('../01-roman-devon/gold-aureus.jpg');
    display: block;
}
However, the image doesn't show up in the epub. When looking at the inspector it's trying to look in a subfolder of the Sigil temp folder, and then appending the URL above to it (including the dots)

This is on Sigil 0.9.6 on Windows. Can anyone help?

Thanks
david_f1 is offline   Reply With Quote
Old 07-24-2016, 04:33 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,942
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
you are using Sigil
Sigil flattens and sectionalizes by file function

Code:
"../Images/gold-aureus.jpg"
theducks is online now   Reply With Quote
Advert
Old 07-24-2016, 05:15 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by theducks View Post
you are using Sigil
Sigil flattens and sectionalizes by file function

Code:
"../Images/gold-aureus.jpg"
And, critically, Sigil does not know how to auto-correct url() links in CSS, which it normally does for the HTML links in the rest of the book.
eschwartz is offline   Reply With Quote
Old 07-24-2016, 06:07 PM   #4
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: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by eschwartz View Post
And, critically, Sigil does not know how to auto-correct url() links in CSS, which it normally does for the HTML links in the rest of the book.
Sure it does. You must have "Mend on Open" enabled, of course. It works for me anyway. I just tested it on an epub I created that used a "pictures" folder instead of "Images." I even added a background image via a css url() link like the one in question that pointed to an image in that "pictures" folder.

When I opened the epub in Sigil for the first time, all links were properly updated (including the css url() link) to reflect the required "Images" folder. When I rename the image file in the Book Browser, the url() link in the css file is also updated to reflect the change.

This is all predicated, of course, on the image(s) being properly manifested in the opf in the first place. If the href in the manifest is incorrect, Sigil can't update the links properly when "normalizing" an epub upon opening -- which is what I'm guessing happened to the OP in the first place, and why the url() link wasn't properly updated. Either that or they really manually typed an url link that cannot exist in Sigil using Sigil. Sigil can't fix what Sigil don't know.

If you want to manually create an url() link to an image file in a css file using Sigil, then it simply HAS to start with '../Images'. Nothing else will work.

Adding url('../01-roman-devon/gold-aureus.jpg') to a css file within Sigil is going to result in broken link every single time. Plain and simple. And nothing is ever going to automatically fix it because there's no matching image in the OPF manifest. There can't be in a Sigil epub.

Last edited by DiapDealer; 07-24-2016 at 06:31 PM.
DiapDealer is offline   Reply With Quote
Old 07-24-2016, 06:36 PM   #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: 8,601
Karma: 5703586
Join Date: Nov 2009
Device: many
Yes as DiapDealer said it will fix url links in the css just fine assuming the url was correct upon import.
KevinH is offline   Reply With Quote
Advert
Old 07-24-2016, 07:17 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Huh. Well then.

Perhaps I misremembered something (or remembered an old something).
eschwartz is offline   Reply With Quote
Old 07-24-2016, 07:29 PM   #7
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: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by eschwartz View Post
Huh. Well then.

Perhaps I misremembered something (or remembered an old something).
Quite possibly an "old something." Because I felt compelled to test just to be certain before I said anything, if I'm totally honest.

Last edited by DiapDealer; 07-24-2016 at 07:33 PM.
DiapDealer is offline   Reply With Quote
Old 07-24-2016, 08:57 PM   #8
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: 45,367
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Hmmm.... a couple of items I've noted is that when an epub has images in an images directory, Sigil will rename the directory to Images but not correct the case in the link so the link is ../images/image.jpg which needs to be corrected to ../Images/image.jpg. If stylesheets are moved to a Sigil created Styles subdirectory from the OEBPS (or equivalent) directory, the links are left pointing to ../stylesheetname.css instead of ../Styles/stylesheetname.css.

The type of epub where any resemblance to the epub standards is purely coincidental.
DNSB is offline   Reply With Quote
Old 07-25-2016, 01:41 AM   #9
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: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by DNSB View Post
Hmmm.... a couple of items I've noted is that when an epub has images in an images directory, Sigil will rename the directory to Images but not correct the case in the link so the link is ../images/image.jpg which needs to be corrected to ../Images/image.jpg. If stylesheets are moved to a Sigil created Styles subdirectory from the OEBPS (or equivalent) directory, the links are left pointing to ../stylesheetname.css instead of ../Styles/stylesheetname.css.

The type of epub where any resemblance to the epub standards is purely coincidental.
As I mentioned above, the only time I see that happen is if the files were not properly manifested in the opf in the first place. If the relative href in the manifest is not correct to begin with (case sensitively correct), links won't be properly updated when opening such an epub with Sigil. That applies to text, images or stylesheets.

The same can happen if errors are encountered when opening an epub and you decline to let Sigil automatically fix them. Garbage in, garbage out.

If you can share non-copyrighted examples of well-formed epubs with properly manifested files whose links aren't properly updated when opened in Sigil, we'll certainly do our best to track the problem down.

Last edited by DiapDealer; 07-25-2016 at 01:50 AM.
DiapDealer is offline   Reply With Quote
Old 07-25-2016, 02:39 AM   #10
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,702
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
@DiapDealer:
I wasn't able to reproduce the OP's issue either, but found out that Sigil doesn't properly resolve stylesheet image references if an epub contains two images with the same file name in different subfolders.

For example, my (valid) test epub contains two different versions of blue.jpg in different subfolders. After opening with Sigil, the second version of blue.jpg was renamed to blue0001.jpg, but the CSS file reference wasn't updated.

Before:
Code:
#blue_one {
background-image: url('../images/blueone/blue.jpg');
}

#blue_two {
background-image: url('../images/bluetwo/blue.jpg');
}
After:

Code:
#blue_one {
background-image: url('../Images/blue.jpg');
}

#blue_two {
background-image: url('../Images/blue.jpg');
}
I realize that the end user is highly unlikely to encounter such a poorly designed epub in real life, but, IMHO, it couldn't hurt to check for this.
Attached Files
File Type: epub normalization.epub (9.2 KB, 340 views)

Last edited by Doitsu; 07-25-2016 at 02:47 AM.
Doitsu is offline   Reply With Quote
Old 07-25-2016, 08:59 AM   #11
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: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
@Doitsu:

It's not just image references in stylesheets that suffer from that problem. Any img hrefs that exist in the (x)html are not updated properly either (under those same conditions).

Actually, I appear to have messed up the case of the href links in my test.

Sigil's normalization process handles the dupe basename situation fine with regard to img hrefs in the xhtml. It still doesn't handle the url() links in css properly, though, with duplicate basenames.

Strange, but very "fringe use" like you mentioned. We'll look into it though.

Last edited by DiapDealer; 07-25-2016 at 09:17 AM.
DiapDealer is offline   Reply With Quote
Old 07-25-2016, 10:04 AM   #12
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: 8,601
Karma: 5703586
Join Date: Nov 2009
Device: many
Yes, xhtml updates use a full parser (gumbo) but the css updates use regular expressions and the key for the regular expression replacement is the original filename not the original full file path. This is hopefully the last hold-over from the old Sigil code-base that had a problem with similarly named files in different directories. I thought I had fixed them all. We will track this down and fix it too.
KevinH is offline   Reply With Quote
Old 07-25-2016, 01:12 PM   #13
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: 8,601
Karma: 5703586
Join Date: Nov 2009
Device: many
A fix for this has been just now pushed to master. It still needs some testing to make sure I did not mess anything up but appears to work with the posted normalization.epub test case.
KevinH is offline   Reply With Quote
Old 07-25-2016, 01:38 PM   #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: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks, Kevin. I'll try to take a peek this afternoon/eve.
DiapDealer is offline   Reply With Quote
Old 07-26-2016, 11:14 AM   #15
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: 45,367
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by DiapDealer View Post
The same can happen if errors are encountered when opening an epub and you decline to let Sigil automatically fix them. Garbage in, garbage out.

If you can share non-copyrighted examples of well-formed epubs with properly manifested files whose links aren't properly updated when opened in Sigil, we'll certainly do our best to track the problem down.
I haven't found this issue with well-formed epubs. This is an issue I see with epubs that are not well-formed often created with older software -- the type of epub that I use Sigil to drag into compliance.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FBReader Pro Default temp files folder OldLincoln Android Devices 2 04-24-2016 10:28 AM
temp file rylee Library Management 4 08-22-2014 07:41 AM
Aura "REWFY.exe" file in my temp folder bawldiggle Kobo Reader 3 08-17-2014 09:31 AM
Conversion and Temp folder issues OscarWilde Calibre 7 11-16-2013 07:45 PM
Calibre files left in Temp folder itimpi Calibre 8 05-06-2009 06:15 AM


All times are GMT -4. The time now is 09:11 PM.


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