Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-28-2017, 09:59 AM   #16
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Fwiw, someone could create a plugin specific to IrFanView that uses the currently selected file info and launches it and writes the file changes back properly via the plugin without having to worry about _org files.

Last edited by KevinH; 09-28-2017 at 11:05 AM.
KevinH is offline   Reply With Quote
Old 09-28-2017, 10:04 AM   #17
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Or perhaps we create an unmanifested file additional Report?
KevinH is offline   Reply With Quote
Advert
Old 09-28-2017, 10:53 AM   #18
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
Or perhaps we create an unmanifested file additional Report?
That would probably be easy enough.

I've never really delved very deeply into the OpenWith code, so I have no idea what would be involved, but it doesn't seem to me that it would be impossible to employ an approach that:

1) copied the file in question to a new temp folder and opened that file in the external editor
2) after the editing is complete, copy ONLY the original filename back to the epub's scratch directory.

Checks could of course be made to determine whether the file was changed or not, and if the original file name is no longer present in the staging temp location (like with an unwise rename), a warning could be popped that nothing is being changed.

Just spit-balling, really. I just don't want to introduce anything into the Open With code that would require any kind of parsing/modification of the EPUB's manifest. File out ... same file name back in.

Last edited by DiapDealer; 09-28-2017 at 11:04 AM.
DiapDealer is online now   Reply With Quote
Old 09-28-2017, 10:56 AM   #19
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Doitsu View Post
When you save and reopen the file, Sigil will ignore all unmanifested files and you'll no longer get EpubCheck error messages, because unmanifested backup files won't be copied to the temp folder of the book.
However, they'll remain in the epub until you save it again with Sigil at which time they'll gone for good.
OK.
Yes.

test: a.epub 237 KB

1) Use "Open with" calling an app that creates backups.
now 288 kB

2) save file -- the backups are in the archive, but not the manifest.
still 288 kB

3) exit
288 kB

4) re-open file -- backups are still there
288 kB

5) save -- backups are gone
211kB


When testing this I stopped first at step 2, then 4. You have to get to 5 before Sigil finally recreates the epub and cleans house.

So as long as such external edits are not the very final thing you do, the unmanifested backups will be discarded.


So I don't have to audit every epub I've edited for the last year. What a relief.
AlanHK is offline   Reply With Quote
Old 09-28-2017, 11:07 AM   #20
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
I like this idea as it is much safer in general. When I get a free moment, I will see if it is an easy modification.

Quote:
Originally Posted by DiapDealer View Post
That would probably be easy enough.

I've never really delved very deeply into the OpenWith code, so I have no idea what would be involved, but it doesn't seem to me that it would be impossible to employ an approach that:

1) copied the file in question to a new temp folder and opened that file in the external editor
2) after the editing is complete, copy ONLY the original filename back to the epub's scratch directory.

Checks could of course be made to determine whether the file was changed or not, and if the original file name is no longer present in the staging temp location (like with an unwise rename), a warning could be popped that nothing is being changed.

Just spit-balling, really. I just don't want to introduce anything into the Open With code that would require any kind of parsing/modification of the EPUB's manifest. File out ... same file name back in.
KevinH is offline   Reply With Quote
Advert
Old 10-01-2017, 10:44 AM   #21
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Found OpenExternally.cpp in Misc. The problem is it uses Qt signals on watched files to know when to update (ie that the application you used with openwith has written something) and uses QProcess startDetached so that the appliction just opened can work in parallel with Sigil allowing full use of the Sigil gui simultaneously.

Since the new process starts in a detached state, no process are done queries or status calls are easily available. We would have to create a new thread to watch a copy of the file being operated on in its new temp location and then write that file back into the correct place where Sigil wants it.

Thus having openwith work directly on the files inside Sigil is much easier/simpler than having to create an additional thread. So the proposed change is not easy unless we create a new watched file pool and figure out how to translate changes in the new temp location to changes in the corresponding internal Sigil file.

It would probably be easier to replace IrFanView with a script that launches IrFanView on the true Sigil location and then cleans up after itself after IrFanView completes.

I still need to check if remove unused images and/or the reports can be used to detect the unwanted files and remove them. Altenatively, a "Remove Unmanifested Files" tool might be generally more useful.
KevinH is offline   Reply With Quote
Old 10-01-2017, 11:27 AM   #22
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by KevinH View Post
It would probably be easier to replace IrFanView with a script that launches IrFanView on the true Sigil location and then cleans up after itself after IrFanView completes.
That would require the user to know about this issue so he'd use this script. My post was prompted by the fact that the files are invisible in the GUI, only shown by an increase in filesize.

But as I mentioned above, it isn't just Irfanview; any program that creates backups, or anything else in the same folder, will result in these files being included in the epub. Many text editors used on the html also will do this, for instance.

However, it seems that closing, then reopening the epub, making any edit, then saving, will lose all the unmanifested files. So they are discarded as long as you do some normal edits within Sigil after the "open with" ones. Or even just prettify the files.

Last edited by AlanHK; 10-01-2017 at 11:29 AM.
AlanHK is offline   Reply With Quote
Old 10-01-2017, 12:06 PM   #23
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks for looking Kevin. That kind of complication is exactly what I wanted to avoid. Most programs that create automatic backups give the user the opportunity to turn them off. It's unfortunate that this Irfanview plugin doesn't, but I can't get that worked up about it (because it's not Irfanview itself that's the problem). It sounds like the plugin dev is amenable to requested changes, though. Perhaps that's the best route forward.
DiapDealer is online now   Reply With Quote
Old 10-01-2017, 04:51 PM   #24
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
I still need to check if remove unused images and/or the reports can be used to detect the unwanted files and remove them. Altenatively, a "Remove Unmanifested Files" tool might be generally more useful.
Rather than a tool, or as well as a tool, have a checkbox setting : Preferences->General->Remove Unmanifested Files on Exit - checked by default, with a Remove Yes/No? if any are found.

BR
BetterRed is offline   Reply With Quote
Old 10-01-2017, 05:05 PM   #25
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Could be done on Save or Save-As in Sigil but not on exit from the Application opened via OpenWith as I tried to explain as those are separate detached processes and nothing in Sigil is waiting for it to close (ie blocking) once started or checking its status.
KevinH is offline   Reply With Quote
Old 10-01-2017, 09:35 PM   #26
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
Could be done on Save or Save-As in Sigil but not on exit from the Application opened via OpenWith as I tried to explain as those are separate detached processes and nothing in Sigil is waiting for it to close (ie blocking) once started or checking its status.
Why did I write on Exit when I was thinking of Save - a'la Mend on Save?

My first thought was to fold it into Mend on Save, but decided it would be better to keep them separate; having just cursed MS for combining the settings for two Windows features I regard as chalk and cheese.

BR

Last edited by BetterRed; 10-01-2017 at 09:37 PM.
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Epub to mobi using KindleGen creates really low quality images – advice needed! Joefish Kindle Formats 8 10-11-2015 07:08 AM
Image (was Sigil) creates a blank page p3aul ePub 3 09-26-2012 10:17 AM
ePub unmanifested files heids124 ePub 21 07-05-2011 10:06 PM
Editing image size benjaminsolah Sigil 6 09-22-2010 06:47 PM
In Design CS3 creates multiple copies of same images! paulgodard Workshop 2 12-13-2009 10:22 AM


All times are GMT -4. The time now is 06:26 AM.


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