This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Displaying EPUBs in QuickView mode. No plugin issue!!!

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC8.5x bug reports (English) Printable version
View previous topic :: View next topic  
Author Message
elgonzo
Senior Member
Senior Member


Joined: 04 Sep 2013
Posts: 288

PostPosted: Fri Jun 03, 2016 3:18 pm    Post subject: Displaying EPUBs in QuickView mode. No plugin issue!!! Reply with quote

UPDATE: I have been informed (here) that the issue is already known and should be addressed in TC9. Smile


There have been several discussions with regard to displaying epubs in QuickView mode (Ctrl+Q) using some lister plug-in capable of displaying epubs.

It has been established that epubs containing Calibre bookmarks will not be displayed in QuickView, and it has been suspected that this is the fault of the involved lister plug-ins.

Today i found out that this is not a problem of a plug-in, but a problem caused by TC.


So, what happens and how does it lead to the observed problem?

When invoking Quick View, TC checks if the file is a ZIP archive. If so, it looks for a file inside that ZIP archive which matches the META-INF/*.txt pattern (coincidentally, the Calibre bookmark file matches).

If such a file is not found, TC will pass control to a plug-in which is associated with the file extension of the quick-viewed file (or, if no appropriate plug-in exists, Quick View will simply show the binary content of the file to be quickviewed). So far so good...

However, if inside the ZIP archive a matching text file (META-INF/*.txt) is found, TC will just show the content of this text file in the QuickView pane, and that's it. As it seems, no plug-in will ever be invoked for Quick View when TC finds such a text file inside a ZIP archive.

I don't know what the reasons are behind this behavior of TC, but it effectively breaks Quick View for files which are using ZIP format and contain a META-INF/*.txt file (such as epubs with Calibre bookmarks, for example).


How to reproduce the problem:

The problem can be quickly reproduced and demonstrated. It is not necessary to have any plug-in to be installed; a clean TC installation is sufficient to reproduce the issue.

1.1. First, let's create a good ZIP file (good.zip).
1.2. Fill good.zip with a few files (shouldn't matter what files you choose).
1.3. Create a META-INF directory inside good.zip, and fill it with some files. Make sure, that the META-INF directory does NOT contain any file with a .txt extension.

2.1. Now let's make a bad ZIP file (bad.zip).
2.2. Make a copy of good.zip and name it bad.zip.
2.3. Add a *.txt file to the META-INF directory in bad.zip. File name does not matter, only the file extension .txt matters.

3. Quick view the good file good.zip. Notice that the Quick View panel shows the (binary) file data of the ZIP file.

4. Quick view bad.zip. Notice that the Quick View displays the content of the text file you placed in the META-INF directory.
_________________
Windows 7 Pro x64 SP1
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Mon Jun 06, 2016 3:22 am    Post subject: Reply with quote

In TC9, you will have the option to set
QuickViewUnzipReadMe=0

to not show readme or other text files from within ZIP files.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fenix_productions
Power Member
Power Member


Joined: 07 Aug 2005
Posts: 1945
Location: Poland

PostPosted: Mon Jun 06, 2016 5:12 am    Post subject: Reply with quote

ghisler(Author) wrote:
In TC9, you will have the option to set
QuickViewUnzipReadMe=0

to not show readme or other text files from within ZIP files.


Would it be possible to also have:
QuickViewUnzipReadMe=-1
to show readme or other text files from within ZIP files *after* plugin check?

It would be nicer to have such fallback if plugins are not able to handle specific files types.
_________________
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
Back to top
View user's profile Send private message Send e-mail Visit poster's website
elgonzo
Senior Member
Senior Member


Joined: 04 Sep 2013
Posts: 288

PostPosted: Mon Jun 06, 2016 5:58 am    Post subject: Reply with quote

fenix_productions wrote:
Would it be possible to also have:
QuickViewUnzipReadMe=-1
to show readme or other text files from within ZIP files *after* plugin check?

It would be nicer to have such fallback if plugins are not able to handle specific files types.

Very good idea!

Also, i noticed that the QuickView of text files embedded in ZIP archives is really confusing. Sometimes works and sometimes does not work as intended (which also explains why i mistakenly believed that this behavior only applies to text files inside a META-INF directory).

Essentially, it will show the first readme.txt that is smaller than 64KB (perhaps including some other common names for text files as well, idk).
If no such readme.txt exist, it will show the first *.txt file in a ZIP archive which is smaller than 64KB.
If all of the text files in the ZIP archive are larger than 64K, TC will actually hand over the file to a lister plug-in (assuming there is a matching plug-in), like as if there were no text files in the ZIP archive.

Which leads to this strange situation where the behavior of TC is not only dependent on the presence of text files in a ZIP archive but also on the size of those text files. Rolling Eyes

I think it would be a good idea to lift this artificial 64K limitation someday. It will make this feature work consistently across the board. (Since in all likelihood i will turn off QuickViewUnzipReadMe, i personally don't mind when it would be improved... Wink )
_________________
Windows 7 Pro x64 SP1
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Wed Jun 08, 2016 10:01 am    Post subject: Reply with quote

Quote:
Would it be possible to also have:
QuickViewUnzipReadMe=-1
to show readme or other text files from within ZIP files *after* plugin check?


This is unfortunately not possible - unpacking occurs before quick view is called, and plugins can only be determined when loading them.

But I have still added
QuickViewUnzipReadMe=-1
now, with a different meaning: It will load readme etc. only from regular archives like .zip, in general those with a packer icon. So if you don't install a packer plugin for .epub, TC will show it with the epub plugin.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC8.5x bug reports (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group