Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Zip Thumbnails (Updated:version 4.6.2, 18.4.2011)


  • Please log in to reply
93 replies to this topic
T800
  • Members
  • 107 posts
  • Last active: Feb 01 2014 11:14 PM
  • Joined: 15 Oct 2006
Details pane is at the bottom, preview pane is placed at the right; see Organize->Layout->Details/Preview/Navigation pane.

Just had a quick look at MSDN and Visual Studio samples. Adding preview pane handler means making a viewer plugin for Explorer, eg. just like Adobe Reader enables reading of pdf files directly inside web browsers.
I was thinking about a viewer as an ActiveX dll or something like that anyway (yea I know, hardcore stuff), so I would probably want to do 2 (or more) birds with one stone. And I can't release a half-product, plus gazillion of other development issues/stuff, all in all... "When it's done".

PS. While I was writing this, a crash error appeared "Preview Handler Surrogate Host has stopped working" (process that actually runs preview). It crashed trying to open preview for saved HTML file. LOL

noboy
  • Guests
  • Last active:
  • Joined: --
Everything looks great after all this time I'm using it, no bugs on my DualCore 2Gig PC too (even on large file contents).

Just a question, now that it thumbnails my zips & rars, do I have a way snag the thumbnail for my personal use - like it cache the thumbnails using windows cache, can it be modified to save it in some folder as jpg?

  • Guests
  • Last active:
  • Joined: --
great!
Works perfect on XP here...
Thanks for sharing it!

Moebius
  • Members
  • 39 posts
  • Last active: May 11 2015 08:46 PM
  • Joined: 08 Mar 2009
How can i use it from autohotkey?

I would like to show the thumbnails on a GUI...
Thanks!

alicialgg
  • Guests
  • Last active:
  • Joined: --
I installed latest version on windows 7 64x with cdisplay 1.8, but i cant see any thumbnail preview. Is there something I am missing?

T800
  • Members
  • 107 posts
  • Last active: Feb 01 2014 11:14 PM
  • Joined: 15 Oct 2006
How to extract thumbnail in c/c++:
//don't forget to check for hr==S_OK

	HRESULT hr;
	HBITMAP m_bmp;

	//pointers to COM interfaces
	CComPtr<IUnknown> m_pthumb;//you can use simple IUnknown* or ATL's smart pointer wrapper
	IExtractImage2* m_pIExtractImage2;
	IPersistFile* m_pIPersistFile;

	SIZE s={    ...... , ......   };   //desired thumbnail width/height
	DWORD flags=0;
	IID CLSID_cbxformatExtractor={0x9E6ECB90,0x5A61,0x42BD,0xB8,0x51,0xD3,0x29,0x7D,0x9C,0x7F,0x39};

	//try to instantiate COM object
	hr=m_pthumb.CoCreateInstance(CLSID_cbxformatExtractor, NULL, CLSCTX_INPROC_SERVER);
	hr=m_pthumb->QueryInterface(IID_IPersistFile,(void**) &m_pIPersistFile);
	hr=m_pthumb->QueryInterface(IID_IExtractImage2,(void**) &m_pIExtractImage2);

	//get thumbnail
	hr=m_pIPersistFile->Load(szFile,NULL);             //szFile is a full path to the file (WCHAR)
	hr=m_pIExtractImage2->GetLocation(NULL,NULL,NULL, &s,NULL, &flags);
	hr=m_pIExtractImage2->Extract(&m_bmp);

//m_bmp now contains thumbnail as HBITMAP
//but don't forget to call DeleteObject in the end

	//finish and cleanup
	m_pIPersistFile->Release();
	m_pIExtractImage2->Release();
	m_pThumb->Release();


I suppose this can be translated to autohotkey, but I haven't used it with COM, try here (+forum posts):
<!-- m -->http://www.autohotke...DllCall.htm#COM<!-- m -->
<!-- m -->http://www.autohotke... ... rd_Library<!-- m -->

@ alicialgg
Read help file first (see also previous posts), try clearing thumbnail cache to regenerate all thumbnails (see help or google)
while listening to In Flames - As The Future Repeats Today :wink:

alicialgg
  • Guests
  • Last active:
  • Joined: --
it worked! I restarted the computer after installing and bum! all my thumbnail appeared!

This is great, Thank you!

finny
  • Guests
  • Last active:
  • Joined: --
Thank you so much for doing this. Can't say thanks enough.
Thank you thank you thank you

EdwinD
  • Guests
  • Last active:
  • Joined: --
.EPub files are e-books which are basically zip files with xhtml and (cover) images. Can CBXShell create thumbnails for those aswell? I could get it to work with cdisplayex but the bugs drove me crazy. and i can't get it to work with CBXShell.

T800
  • Members
  • 107 posts
  • Last active: Feb 01 2014 11:14 PM
  • Joined: 15 Oct 2006
By design, I didn't go for binary file recognition because that can be complicated given that archives can be self-extracting exes, etc.
When I get some spare time maybe I'll add something like user-defined file extensions support.
For the moment, I just added if (StrEqual(szExt, _T(".epub"))) return CBXTYPE_CBZ; at line 542 in cbxArchive.h.
32 & 64-bit dll:
<!-- m -->https://ahknet.autoh...CBX/cbx4203.zip<!-- m -->

If you already used installer (if not, use it first to make this simple), you can replace dll files like this:
1. Extract 32 or 64-bit dll from zip (must match your Windows edition).
2. open command prompt (elevated if Vista/7 under UAC)
3. close all windows and applications, then wait a minute or two so that system releases files in use.
4. type in the command prompt: copy "<path of the new (unzipped) dll>" "<path to the old (installed) dll>" (use quotes if needed)
If all OK it will say that it copied 1 file.

Also, the question is if e-books (*.epub....) fall under this topic, because it seems to me that it should be a project for itself, from my experience cb* files are more similar to archives then are e-books which only use compressed file as a container (wikipedia topic on ebooks talks about html, xml, svg, etc.).

After all, the source code ist fur alle da.

athlonxp
  • Guests
  • Last active:
  • Joined: --
Could you please compile a binary package without SSE2 optimizations?

T800
  • Members
  • 107 posts
  • Last active: Feb 01 2014 11:14 PM
  • Joined: 15 Oct 2006
Ok, here are dlls without SSE
<!-- m -->https://ahknet.autoh...bx4203noSSE.zip<!-- m -->

I could use some feedback on this. Do you run some older hardware?
AFAIK, SSE was introduced in Pentium III in 1999, and SSE2 in P4 processors in 2001.
Here are 3 versions of my test app in release compile: no SSE, SSE, SSE2, optimizations set for speed.
<!-- m -->https://ahknet.autoh...CBX/SSEtest.zip<!-- m -->
Drag and drop files onto dialog to test.
You can tell me how they behave, post messages/screenshots of errors.

athlonxp
  • Guests
  • Last active:
  • Joined: --
Well, Athlon XP processors don't support SSE2. The last batch of them came out about 5 years ago, they were really popular, many people still use them. Then netbooks became popular, most didn't support SSE2, the bottom line is hardly anyone optimizes 32-bit desktop applications for SSE2 even today. And, in general, you get better performance from non-SSE2 32-bit binaries than optimized 64-bit ones (although the difference is negligible of course).

I did try the tests but couldn't notice any difference, mainly because results varied wildly with each use. Can you make the test run multiple (50-100) times automatically?

Thanks for the build :)

athlonxp
  • Guests
  • Last active:
  • Joined: --
And here's the crash report for CBXTest_SSE2.exe on an Athlon XP


Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	CBXTest_SSE2.exe
  Application Version:	0.0.0.0
  Application Timestamp:	4bdcd95d
  Fault Module Name:	CBXTest_SSE2.exe
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	4bdcd95d
  Exception Code:	c000001d
  Exception Offset:	00002c66
  OS Version:	6.1.7600.2.0.0.256.1
  Locale ID:	1033
  Additional Information 1:	0a9e
  Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:	0a9e
  Additional Information 4:	0a9e372d3b4ad19135b953a78882e789


T800
  • Members
  • 107 posts
  • Last active: Feb 01 2014 11:14 PM
  • Joined: 15 Oct 2006
I tried test app with 100 iterations, and there was no real difference (the only reason I enabled SSE in compiler settings was simply because 'it's there, so crank it up').
I recompiled all without SSE, version 4.4, you can download updated package. This should run on any CPU.