ZTree.com  | ZEN  | About...  

 Index   Back

Thank you, thank you, thank you!   [Tip]

By: Martijn Coppoolse   Homepage   Voorburg, NL  
Date: Feb 04,2015 at 04:22
In Response to: Thank you, thank you, thank you! (Andrew Watson)

> Thank you, thank you, thank you!

You're welcome!
The usual "standing on the shoulders of giants" applies, of course: all I did was wire up existing components and libraries written by others. The most work went into reading ZTreeWin's zbar.dat file, and turning that into an easily reusable class... :-)

And thank you for the extensive review and comments!

> I am using ZPreview64 and ZTW64.exe under Windows 8.1 Update 64 bit.

Note that either version (64- and 32-bits) will work with both ZTW and ZTW64; they're separate programs, so the bitness doesn't matter. I just made a 64-bit version because it's (probably) the future, and because it was a matter of three extra clicks (plus a few conditionals to disable FreeImage, which only provides a 32-bits binary for download).

> Works perfectly viewing JPG (see BUG report for OneDrive problem), BMP,
> PNG, MV3 (whatever they are), some DAT, GIF, ICO, OneBin (OneNote), TIF,
> some TMP but not WMF (which is surprising given it's an MS format)
> files.
> These files were found after a quick scan of the files on my PC. I may
> have missed some viewable extensions.

You can find and install other Windows preview handlers.
If you install the free Nitro PDF Reader, it installs a preview handler for PDF files. ZPreviewer will then display PDFs as well. (Even if you don't use Nitro otherwise, and have PDF files associated with another program).

Here are some other free preview handler packs:
https://previewhandlers.codeplex.com/ (various source code files with syntax highlighting)
http://code.google.com/p/delphi-preview-handler/ (some more source code files with syntax highlighting)

Since it's possible to have multiple preview handlers for the same file type, but only one associated with it, Stephen Toub has written a Preview Handler Association Editor, which lets you choose. This also provides an overview of all installed Preview Handlers.

If I ever get around to providing a choice between multiple viewing options for a specific file, I might riff off his code and build it into ZPreview — time, motivation and occasion granted, of course (ha!).

> I was going to ask whether it used the file extension to determine
> whether ZP could display a file but it obviously scans the content of the
> file because it was able to display some no extension files.

FreeImage and the Delphi graphics routines just try to load the file, regardless of the extension; only if that doesn't work out does ZPreview try other means. The Windows Preview Handlers are associated by file extension.

> Is there a web page anywhere that lists what file formats should be
> able to be displayed?

1. When using FreeImage, see the list of supported formats on their site.
2. See the Preview Handler Association Editor mentioned above.
3. There are many WLX Lister plugins available at the site of TotalCommander.
3. The Delphi graphics routines currently support GIF, BMP, ICO, and I expected it to support WMF as well. It's trivial to add support for JPG and PNG (literally two words each), so I'll do that soon, and will look into handling WMF and EMF as well, since I know Delphi supports them.

> However...
> There are always howevers.

Aren't there just? :-)

> I would like to make the following ZPEPs (ZPreview Enhancement
> Proposals)
> 1. Always on top option for the main window, the Sentinel window (which
> I think is only useful for developer) and the Image Info window (that I
> have never seen because I am using the 64 bit version).

Good point. I'll pick this up with the window positioning in general (at least store the latest window position, possibly adapt to ZTreeWin's position).

> 2. Full or Parent or Current path in Title Bar option

Heh, I omitted this because I've got two screens, but that could be handy indeed.

> 3. Fill window with image option

Zooming options are currently only supported using the FreeImage library. While I can adjust the Delphi graphics to add this, I have no control over the Windows Preview handlers.

> 4. The Sentinel window is semi transparent. I don't want it but some
> may wish to have the option to make all windows opaque or with varying
> degrees of transparency.

I feel a settings file coming on... The UI may come later. ;-)

> 5. Name the versions ZPreview32.exe and ZPreview64.exe so they can
> co-exist in same directory.

Another good point.

> 6. If ZP can't display a preview have an option to display file
> contents like F7 in ZTW (I leave it as an exercise for the developer to
> decide how many of the ZTW F7 options to include).

That one is on my to-do list, but with (very) low priority. After all, just minimize the window, and use ZTreeWin's viewer...

> BUGs

Thanks for the extensive reports!

> I suggest a single toolbar with no quirks.

My thoughts exactly. I used the TCoolBar component, but it turns out to be a lot more finicky (not to mention buggy) than expected.

> You may wish to add my ZPEPs to the single toolbar. Possibly as icons
> with tooltips as window is likely to be windowed and there may not be
> enough room to display full text buttons.

I had hoped that the toolbar component would display the text as well as the buttons, and started collapsing the text whenever the toolbar got too small. If it doesn't, I'll just do the icons.

> 2. The Image Info button should be removed in ZP64.


> 3. From the description I was under the impression it displayed the
> contents of PDF files but it doesn't for me.

You need to install a PDF preview handler (there are many; Adobe, Nitro PDF, PDF-Xchange and Foxit all have one).

> 4. ZP can't view OneDrive JPG placeholders, as you would expect. At
> least it doesn't trigger a download though I did get an error message
> "Unable to open file [1223]. I did get another one with a red X that I
> can't replicate though I suspect it was caused by me cancelling a
> OneDrive download caused by Open in ZTW before it had finished. It was
> probably an IrfanView error message.
> I did manage to replicate it by ESCing from the download. The text is:
> This file does not have a program associated with it to perform this
> action. Please install a program or, if one is already installed, create
> an association in the Default Programs control panel.
> I also got the 1223 error at the same time.

Hm. Error 1223 is ERROR_CANCELLED... So that's an interesting one. Could you send me a screenshot of that error? I'm curious where it's being triggered.

> 5. I did get a ZP stream read error a couple of times. I had to shut
> down and restart ZP to get it working again.

Ah yes, I had a suspicion that the plugin handler host component opens the file with 'deny' options, and doesn't free it as soon as possible. Will look into that.


Thread locked

Messages in this Thread

95,097 Postings in 11,989 Threads, 350 registered users, 79 users online (0 registered, 79 guests)
Index | Admin contact |   Forum Time: Sep 20, 2020 - 9:29 am EDT  |  Hits:34,153,849  (10,405 Today )
RSS Feed