Forum moved here!

# Home / Icon Association

BKPB

The program is associating PDF files with the icon of 1 SumatraPDF.exe (Icon Group: 1),
and DJVU files, EPUB, FB2 icon 2 from SumatraPDF.exe (Icon Group: 2).
How do I make manually via the registry, that would be ( for example, a DJVU file, was associated with icon 3 (Icon Group: 3)
This is only for personal purposes and for the convenient use.

SumatraPeter

If you’re unsure about locating and editing the relevant registry entries I highly recommend you use a GUI utility like NirSoft’s FileTypesMan instead.

BKPB

Thank you. I did. Everything works.

innn

HI, I logged expressly to ask if it would be possible to improve the main icon? I always change it on my computer. I understand the need for alerting yellow-black but the outcome is not exactly splendid. Maybe I can come up with a version of my own but first I must ask if there is in demand.
Thanks anyway

kjk

I’m not opposed to using a better icon.

That being said “better” is subjective so there’s no guarantee that we both agree what better icon is and it would have to be significantly better to justify changing it.

SumatraPeter

Oh yes, there is demand all right, going back many, many years. Much more so for the document icons than the main program icon of course, but that’s understandable. If you’re a graphic designer then by all means I’d say share your complete icon set for the program. Thematically similar/related icons for the program and all the supported formats that are easily recognizable, look good at all sizes including tiny 16x16 onwards and so on would be really appreciated, and then the dev and we the community can give our comments. I’m sure it would be great for any designer to see his work being accepted to represent a popular program that’s used by tons of people all around the world.

musm

Chiming in to also request better icons. Honestly the glaring yellow is terrible and is in desperate need of a modern icon set.

See

smile66

Hello there,
SumatraPDF PDF Reader is a super program.
I love it very much, thank you.
But when it is the default program, it will be much more beautiful if the icon changes according to the extension, so for PDF, ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR, each icon will be very beautiful.

(My english is so bad i apologize for this)

GitHubRulesOK

Not an unreasonable idea at first glance,

That problem is covered by an open issue on GitHub

It goes much deeper than it looks since there is also txt azw azw3 prc oxps xod jpg png tif tga bmp dib htm html zip … … … … … … … and thats just a few more

What about its own files like .smx .bkm … etc

Perhaps for now just one bright yellow one will do to indicate the default files handled by ONE application?
MS screwed up by having a different icon for their Edge app compared to the traditional When compared to most of their other apps e.g. NotePad or i.e ONE icon suits all the different file types each app handles.

SumatraPeter

IMO they finally did something right. Using a common icon for all the possibly gazillion file types supported by an app is a ridiculous and lazy way of doing things. Now I don’t blame Notepad and Paint so much because they’re ancient apps that until recently were basically left untouched for decades and date back to when they possibly just handled .txt/.doc (not the Word .doc) and .bmp/.pcx respectively. However if a modern app like say my video player were to start doing this it would drive me nuts. It supports a whole bunch of audio/video formats, and the fact that it has a unique (yet thematically similar) icon and file type description for each means I can sort properly by type in Explorer and also immediately tell at a glance what I’m working with. Maybe some folks don’t care about having different file formats all bunched together and looking the same, but others (including me obviously) certainly do.

The ideal situation for me would be for Sumatra’s EXE or a separate DLL containing distinct icons for each supported file type, all following a common design theme of course. That way I would no longer have to assign my own icons every time manually when installing the app for the first time and associating it with file types of my choosing (well actually I have a .reg for it, but the point’s still valid).

Perhaps instead of waiting indefinitely for some graphics designer to custom design and contribute a bunch of icons, it might be better to just pick from some free set and go ahead, or possibly even commission a set.

smile66

All file type icon images are the same

I have a question.
I wonder if the SumatraPDF icon image can be changed for each file type?
Now they all have the same icon image.

GitHubRulesOK

It is a long time question, and the answer is still the same as per your question in May

All filetypes open by an application have a default icon as set by “Windows” file association

SumatraPDF can display many filetypes but its logo is only applied to those that you set it to be the default opener

A user or their application can change the logo for a given filetype so you can change the icon for .cbx to any that you like but windows 10 does not make that easy (you need a good app such as Nirsoft FileTypesMan to make such changes that affect the registry) see @SumatraPeter 's post above

Also note that in general if you change the default logo for cbx as I did above then all other related file associations (like mobi and .vbkm) are ALSO FORCED by Windows to the same icon
The underlying historic principle was ONE icon for ONE default associated Application. (not one per filetype)

There are ways to over-come windows enforcing those changes

but it requires a well built set of icons which SumatraPDF does not currently have. Its still the same one month later as per the link above

In short user setting icons per application or extension is a Windows Explorer feature
Sure SumatraPDF could have inbuilt icon sets at approx 2.5 per MB.
So nearly 50 filetypes would only bloat the exe by say another 20 MB

The way round bloat is to have the icons in an externally accessible ico library. with as many colourway preferences as there are users. Thus no need to slowdown SumatraPDF each time an icon is fetched for refresh.

Much simpler and more efficient for the system user to use their own ico libraries for their desired subset of filetypes, and remember the icons must work in explorer at 16x16 pixels

For compatibility across every use the minimum is the safe 16 colors

Here I have deliberately chosen to start with a basic DjVu and Mobi ico since they are 4 characters wide anything else is easier. Feel free to use these basics and change text and colors for those from the above 50 types you use.

SumatraPeter

Come on, let’s not exaggerate! My Win10 version’s imageres.dll contains 412 distinct icons, each with multiple versions at varying color depths and sizes ranging from 16x16 to 512x512 px, and that comes to 22.4 MB, while shell32.dll at 21.1 MB contains 329 distinct icons. Not to mention these files contain a bunch of non-icon data as well, including cursors etc.

A thematically similar bunch of icons OTOH would tend to compress quite well. In fact, I just checked the icon DLL used by my video player, and it was all of 2.4 MB in size despite containing 81 icons (same basic shape, just different colors and different text for each supported file type - just what Sumatra needs). Any ‘bloat’ would thus be even less if the same data were to be embedded in the Sumatra EXE itself, since there’d be none of the separate DLL overhead. A couple of MB is peanuts, not ‘bloat’!

(In any case none of this discussion about potential ‘bloat’ makes any sense until someone submits an icon set or one is selected from somewhere…)

Windows caches icons, but even otherwise why would a running copy of Sumatra slow down in case the OS needs to extract icons from the EXE?

GitHubRulesOK

Dedicated icons are not the same as a suite just for one filetype
Each type as a working minimum must have 16x16 (no problem) but it is so crude that the recommendation is and 32x32 and 48x48 and 64x64 and 128x128 (each should be included at both 4bpp and 8bpp) which are still often fuzzy if not augmented by other scales. many users start with 16M colors in glossy 256x256 then wonder why they do not work at smaller sizes, start with the root and it very soon branches out.
Compression is not recommended, all smaller ones are bmp/dib except png is permitted for the largest.
here are 8 sizes just for a chm filetype (personally I prefer the one included in windows)

So for just one extension the ico file is

You are right that since we can now drop any XP formats and only use vista formats as a baseline, then PNG (Portable Network Graphic) compressed professional icon sizes are about 150Kb

SumatraPeter

That seems to be a pretty bad (unoptimized?) example. Take icon 101 in imageres.dll for instance - 13 images ranging from 16x16 4-bit BMP to 256x256 32-bit PNG (see below). The icon’s definitely far more complex than your simple blocky CHM example with a limited palette, and yet the entire thing when extracted as an ICO from the DLL totals to only 118 KB:

GitHubRulesOK

Currently SumatraPDF “application” icons are 286 KB before inclusion
The filetype ones are generally under half that at about 128 KB each

Again I have to agree that MS do as they do, not as they say, they have used different ranges of sizes throughout that win 10 resource, so for Icon 101 there are no bigger ones such as 64x64 or 128x128. However a SumatraPDf old clone was almost doubled in size from 5-10 MB so as to carry just 12 different file type icons, so looks like they thought some were needed (but that could likely be for XP and Vista).

Looking at one intended for Documents (090)
MS only use the 32bit variants so its now down to 50KB each

SumatraPeter

I guess it can easily be downsampled by the OS as required from the bigger 256x256 32-bit PNG that is included.

Great, so 50 such icons would run up only 2.5 MB or so - a far cry from 20 MB! Hardly worth quibbling about even if included in the EXE itself.

To be perfectly frank I wouldn’t care two hoots even if Sumatra came packaged with a 20 MB file type icon DLL. The benefits IMO would far outweigh the space taken. Those who wish to save that amount of hard disk space would be free to get rid of the file and use a single icon with no detriment to program functionality.

GitHubRulesOK

Peter
I am having lots of trouble trying to retrofit icons per filetype using a .dll (my preference). As explained above MS likes to change (force) all types associated with an application to the same icon, it is a PIA having to keep re-cycling round ones previously set. It could be this heavily used abused registry
I guess it would need them to be assigned, all in one hit, to the equivalent of different (mime)filetypes, which makes for a much larger task, certainly its then suited to the installer

SumatraPeter

It’s not forcing anything actually but simply selecting a default value for the icon. If an app doesn’t register the extensions and icons itself properly and one manually associates any extension with an app using Open With, one ends up with:

HKEY_CLASSES_ROOT\.ext having its (Default) value as “ext_auto_file” (where “ext_auto_file” = File Type)

HKEY_CLASSES_ROOT\ext_auto_file having its (Default) value as “File Type Description String”

HKEY_CLASSES_ROOT\epub_auto_file\DefaultIcon having its (Default) value as “Path to Icon File or Resource in EXE/DLL/etc.,Resource ID”

Now by default naturally Windows will select “Path to Program EXE,1” as the icon for whichever file type you associate with the EXE, simply because it has no other choice. Even if the EXE for example contains a 100 icons, how is Windows to know which icon resource ID it should associate with which extension? It also cannot randomly associate icons because that would be ridiculous, so it does the best it can. After that it is up to us to change the icons if we so please, and Windows doesn’t tamper with them in my experience unless you go about tinkering with the extension association again (perhaps use Open With again for the same ext).

Thus for example we can have:

[HKEY_CLASSES_ROOT\.epub]
@="epub_auto_file"

[HKEY_CLASSES_ROOT\epub_auto_file]
@="EPub Document"

[HKEY_CLASSES_ROOT\epub_auto_file\DefaultIcon]
@="C:\\Program Files\\SumatraPDF\\SumatraPDF.exe,1"

[HKEY_CLASSES_ROOT\epub_auto_file\shell\Open\Command]
@="\"C:\\Program Files\\SumatraPDF\\SumatraPDF.exe\" \"%1\" %*"


and

[HKEY_CLASSES_ROOT\.mobi]
@="mobi_auto_file"

[HKEY_CLASSES_ROOT\mobi_auto_file]
@="MOBI Document"

[HKEY_CLASSES_ROOT\mobi_auto_file\DefaultIcon]
@="D:\\My Icons\\Mobi.ico"

[HKEY_CLASSES_ROOT\mobi_auto_file\shell\Open\Command]
@="\"C:\\Program Files\\SumatraPDF\\SumatraPDF.exe\" \"%1\" %*"


Both file types associated with Sumatra, but with distinct icons. Once one has made the necessary registry edits either manually or with a GUI app such as NirSoft’s FileTypesMan, one can simply export the keys as .REG files and back them up along with the icon files, to be quickly reapplied whenever required (say after a reinstall or a fresh install).

P.S. If multiple extensions have the same File Type value then naturally they will share the same icon, description, open command etc.:

[HKEY_CLASSES_ROOT\.epub]
@="SumatraPDF"

[HKEY_CLASSES_ROOT\.mobi]
@="SumatraPDF"

[HKEY_CLASSES_ROOT\SumatraPDF]
@="SumatraPDF Document"

[HKEY_CLASSES_ROOT\SumatraPDF\DefaultIcon]
@="C:\\Program Files\\SumatraPDF\\SumatraPDF.exe,1"

[HKEY_CLASSES_ROOT\SumatraPDF\shell\Open\Command]
@="\"C:\\Program Files\\SumatraPDF\\SumatraPDF.exe\" \"%1\" %*"
Burt

Hello,

Wow, I didn’t realize quite the headache associated with file associations based upon icons. In my limited world of using most of my Win 10 apps, there has always been this issue. Now I know that it is an issue.

I guess I will explore using Calibre to associate the file types with Calibre. By the way, where is SumatraPDF.exe hiding in the Win 10 environment? I don’t seem to be able to find it. I know that it must be somewhere because SumatraPDF works.

Cheers,
Jim