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 01-12-2020, 03:18 AM   #1
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
Bug or Feature - Replacing link while adding a file

Hi,

this happens in Sigil 1.0.0 on macos mojave

I have a series of books which all should have a similar titlepage and the stylesheet should always be the same.

So i created a file "titlepage.html" and a file "Style0001.css".

The head of the html page looks like this:

Code:
<head>
  <title></title>
  <link href="../Styles/Style0001.css" type="text/css" rel="stylesheet"/>
</head>
When i now add this file in sigil via the "+" Button (without adding the stylesheet at this point) sigil modifies the head section like this:

Code:
<head>
  <title></title>
  <link href="../..//Users/xxxx/Work/Styles/Style0001.css" type="text/css" rel="stylesheet"/>
</head>
For me, this does not make sense at all, i would like to have the file added unchanged.

PS Same happens with other links eg src links for pictures.
Seems that all links are replaced with the folder from which the import was invoked

Last edited by Vroni; 01-12-2020 at 04:17 AM.
Vroni is offline   Reply With Quote
Old 01-12-2020, 07:12 AM   #2
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
I've noticed this as well with image "src" references on Windows 10.
Turtle91 is offline   Reply With Quote
Advert
Old 01-12-2020, 09:59 AM   #3
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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
How are you adding the html file? Are you properly using AddExisting...? And selecting the html file? And *before* adding it, is its link to the stylesheet correct? If not correct, that will create an issue.
KevinH is offline   Reply With Quote
Old 01-12-2020, 02:06 PM   #4
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
I thought i have everything explained what i did in my first posting.
Vroni is offline   Reply With Quote
Old 01-12-2020, 04:18 PM   #5
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
For me to reproduce, all I have to do is 'add existing' html file that has a <img> that is NOT already in the epub. On add, it changes the src reference to:
src="../../C%3A/Users/ddgra/Documents/eBooks/Images/xxxx.png"

If the resource already exists in the epub then it keeps the original reference as:
src="../Images/xxxx.png"
Turtle91 is offline   Reply With Quote
Advert
Old 01-12-2020, 07:15 PM   #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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes, it should never create a relative path outside the epub folder or Sigil space.
I will look into it.

In general Add Existing should be pulling in all properly linked resources like stylesheets and images. Only if the link itself is broken should it try something else.
KevinH is offline   Reply With Quote
Old 01-12-2020, 09:50 PM   #7
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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay, I finally found some time and used "Add Existing ..." and selected a html file that had links to both a stylesheet and 3 images.

All were correctly imported and all of the links were correct.

So I can not reproduce this bug in current master, which probably means this bug was already fixed. The fix will be in the next release.

Turtle91, can you still reproduce this bug using the debug build that DiapDealer posted for you. That build is very close to current master and should not exhibit the problem.

Also, I would love to get some new debug output for your two screen crash issue, so we can get that one tracked down and fixed as well.

KevinH
KevinH is offline   Reply With Quote
Old 01-12-2020, 09:52 PM   #8
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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
I had no idea what you meant by "+" and it was not clear if the link out of the html file was correct or not. That is why I asked.

I think this bug is already fixed in master.

Quote:
Originally Posted by Vroni View Post
I thought i have everything explained what i did in my first posting.
KevinH is offline   Reply With Quote
Old 01-12-2020, 11:25 PM   #9
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 KevinH View Post
Turtle91, can you still reproduce this bug using the debug build that DiapDealer posted for you. That build is very close to current master and should not exhibit the problem.

KevinH
Yes, it is happening on the debug build. It does not pull in the resource (image) when added.

The html file I am adding has the following <img>:
<p class="hdr">Words <img alt="" src="../Images/example.png"/></p>

Does Sigil look for the image in that relative folder '../Images/..' or does it need to be in the same folder as the html and Sigil files? Both the .png and the .html file are in the same folder, but it is different than the Sigil file.

My html/png folder is located here: C:\Users\ddgra\Documents\eBooks\Logos

While the Sigil temp directory is here: C:\Users\ddgra\Documents\eBooks\Sigil Temp Docs\Sigil-fGVMKp

That is not the default Sigil temp directory.
Turtle91 is offline   Reply With Quote
Old 01-13-2020, 12:14 AM   #10
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,585
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
Not sure if this helps, but I tested this two ways using the latest build (9c6905a) on macOS 10.13.6.

I started with a blank Sigil epub with no images or stylesheets.

I used the "+" icon to import an html file from a folder on my desktop that was linked to an image and a stylesheet in the same desktop folder. The html file was successfully imported and the linked image and stylesheet were automatically imported in the same step.

I then imported an html file that had links to a non-existent image and non-existent stylesheet. In that case, the link in the html file was altered to: src="..//Users/oda/Desktop/ ..."
odamizu is offline   Reply With Quote
Old 01-13-2020, 03:26 AM   #11
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
Quote:
Originally Posted by KevinH View Post
I had no idea what you meant by "+" and it was not clear if the link out of the html file was correct or not. That is why I asked.
Well, theres a button having a "+", you can move the curosr over it, then click on it, than the Add Existing File DIalog is popping up.

I posted the head section and i thought it was obvious that the this part was syntactically correct. Semenatically the reference didnt exist in the epub.


Quote:
Originally Posted by KevinH View Post
I think this bug is already fixed in master.
Reading odamizus post it isnt. And what i did was exatly written downh in my first post. Adding the html file ONLY is resulting in the modification.

If you do it the other way round (first insert stylesheet or vene insert both at the time time) everything is fine.

As i dont have access to the new master i cant proof it.
Vroni is offline   Reply With Quote
Old 01-13-2020, 08:10 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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
The key point here for Add Existing... when loading an html file for it to pull in any properly linked images and stylesheets the links to those images and stylesheets must be correct (work!) at the place you are loading it from with relative links (just like normal html). Otherwise Sigil can not find them. In other words if you instead loaded that html file in a browser before loading it in Sigil, all images and stylesheets must be found just like when importing an html file from an existing website or epub.

So based on Odamizu's post, the "problem" only happens when the links are already broken *before* attempting the AddExisting. Otherwise AddExisting works correctly.

So it happens when Sigil tries to fix up already broken links. Effectively it took a broken link and generated another broken link because it could not find the file linked to, or a resource by that name already existing.

Not sure if that can even be called a bug! I will look into it when I get a free moment.

Vroni, if all you want to do is get the html without any attempt to get its linked in resources, simply copy it and paste it in. Or make the links in the html external ones (http://blah) and they will not be touched.

Last edited by KevinH; 01-13-2020 at 08:12 AM.
KevinH is offline   Reply With Quote
Old 01-13-2020, 08:16 AM   #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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
Vroni, ps: there is no way to add the html file ONLY that has broken relative links in it. If it is a block of text you want, simply copy and paste it.

If you have a template styles, images, and html that you want, set the links properly one time and use AddExisting to load all at once properly.

Last edited by KevinH; 01-13-2020 at 08:47 AM.
KevinH is offline   Reply With Quote
Old 01-13-2020, 08:52 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,539
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
In all fairness: this used to work as both Vroni and Turle91 expect it to before Sigil v1.0.0. If linked resources were present and accounted for (the relative href/src attributes led to actual files), then those resources were added along with the added xhtml file (and all links were adjusted according to Sigil's old structure requirement), but if the relative href/src attributes led nowhere, those href/src attributes were left untouched when added to Sigil. In other words ... invalid relative links weren't altered upon import. Sigil was fine with importing html files with broken links.

It is the latter part of that behavior that has changed since Sigil v1.0.0.

If that's the way it has to be because of the nature of Sigil 1.0.0, that's fine. I just want to make sure everyone is on the same page here regarding the issue. And if so, I can always create an "Add xhtml as is" Edit Plugin to regain the desired functionality.

Last edited by DiapDealer; 01-13-2020 at 08:54 AM.
DiapDealer is online now   Reply With Quote
Old 01-13-2020, 10:44 AM   #15
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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
Just so that I understand ... If a link is broken, you want to import it as is?

Why? If it does not point to anything before import, why on earth would it point to anything after we import into a new epub?

Are people trying to "pre-edit" the links in an html document before importing it? If so, how would they know the actual structure in the epub unless they assume it will always be in standard format?

If so, wouldn't it be better just to fix the original links so that they point where they should?

Right now, any link will be updated if we move the original file (which is what AddExisting an html file really is doing). At the time of the move, we can not check if an image or stylesheet will actually exist in the final location or not. In the past in a fixed layout, the link to any resource from an xhtml file never depended on the position of the xhtml file or resource due to the fixed layout.

For example: A link from any html to any stylesheet could always be written as ../Styles/sheet.css. A link from any html file to any image could always be written as ../Images/image.png, etc.

Now (since Sigil 1.0) that is no longer the case and can not be assumed. So there are no position of html independent links to resources anymore and leaving them un-updated by the move of the html file simply does not make sense.

So the only way around this is to somehow check if a link exists or not before updating it and that would be hard to do. The universal update code now assumes that every existing link is correct. In the past when we moved all files at the same time together we had a prebuilt list of all links sources and destinations and it no longer does that.

So if this is really important, we will have to figure out if a link is correct on the fly during the move and therefore that the order of the links updates would then matter (ie. can't check if it exists in a future place, only in the past location, etc).

If this is so that people can "pre-edit links" in an html file before adding it, I really do not think it is worth the trouble.

KevinH

Last edited by KevinH; 01-13-2020 at 11:01 AM.
KevinH is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing or Adding embedded MOBI cover Timboli Library Management 1 10-28-2018 03:45 AM
table of content file link not add in toc.ncx file bhambhu Conversion 0 01-14-2016 01:40 AM
Adding books with the same titles by replacing them alexthunder Library Management 2 07-09-2012 01:08 AM


All times are GMT -4. The time now is 01:58 PM.


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