![]() |
#1 |
Junior Member
![]() 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; } This is on Sigil 0.9.6 on Windows. Can anyone help? Thanks |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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" |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)
|
|
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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). |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() Last edited by DiapDealer; 07-24-2016 at 07:33 PM. |
|
![]() |
![]() |
![]() |
#8 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,507
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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'); } Code:
#blue_one { background-image: url('../Images/blue.jpg'); } #blue_two { background-image: url('../Images/blue.jpg'); } Last edited by Doitsu; 07-25-2016 at 02:47 AM. |
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#15 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,367
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |