Get files in my own file format for its own dynamic icon

0 votes
The file format of my application is very similar to the OpenDocument file format, i.e. zipped with a manifest file, a thumbnail image, etc. (check - Now, in both Windows and Linux, the OpenOffice files have a preview image of the Open Office file as their icons. Can the same be done for my files, i.e. a dynamic icon based on the internal thumbnail.png? Plus, some info or links to how OpenOffice does their IconHandler stuff would be very helpful as it is similar to that of my app. TIA!
Jan 8, 2019 in Others by Bharani
• 4,660 points

1 answer to this question.

0 votes

Regarding MAC support, "The Mac and Windows operating systems have different methods of enabling this type of thumbnail, and in the case of the Mac OS, this support has been inconsistent from version to version so it hasn't been pursued [for Adobe InDesign]."


An Icon Handler is what you are looking for. It is also known as a Thumbnail Handler. Check out this sample example written as an active x control. Also, look up Property Handlers, which points to the latest and the best way of having dynamic metadata handled properly in windows.

Now, you won't be needing such dynamic solutions if you just want an icon to be associated with all your files. So, use them only when you'd want windows explorer to display an icon based on the file's content and not just the extension. That means when the file changes, the icon is also updated to reflect those changes. But, it doesn't necessarily have to be an image of that file itself as the thumbnail handler can generate any image based on what's in the file.

Since the property handler updates other metadata such as audio or video length, you can use all the metadata that Windows Explorer supports.


The Launch Services Database determines the icons for Mac OSX. But, it refers to a static icon file for all files handled by a registered application. So, it's not based on the extension. Rather, each file has attached metadata to determine its respective application. Although, extensions do help when no metadata exists, like when getting the file from a different OS or file system. The dynamic icon functionality in OSX seems to be provided by Finder.


You can use a thumbnailer for Gnome. It's a very simple program, which has 3 command line arguments:

  • input file name, the file you are describing with the thumbnail (or URI if you're accepting those instead)
  • output file name, where you need to write the PNG
  • size in pixels, a number that describes the maximum square image size you should produce (128 --> 128x128 or smaller)

In contrast to all the difficult to implement plugins on other systems, this system is simpler but doesn't support animation and a few other features.


Konqueror is the file manager here and displays the icons. So, it supports dynamic icons for some inbuilt types, but I can't say if they are hardcoded or are  just plugins that you can write. Read: Embedded Components Tutorial for more info.
Also, there's this new or upcoming feature called Plasma that deals with icons and icon functionality. Here's the announcment.
You might have to dig into the source of Konqueror to underdstand how they did it for text files and other files that are already implemented.

answered Jan 8, 2019 by DataKing99
• 8,240 points

Related Questions In Others

0 votes
1 answer

Change the permission for a file created by me in linux

If you are the system administrator or ...READ MORE

answered Mar 8, 2019 in Others by Nabarupa
0 votes
1 answer
0 votes
1 answer

Language independent way to get "My Documents" folder in VBA Excel 2003

 Hello :)  This code may help you in your ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,670 points
0 votes
2 answers

In Python, how do I read a file line-by-line into a list?

readline function help to  read line in ...READ MORE

answered Jun 21, 2020 in Python by sahil
• 580 points
0 votes
1 answer

When to use file vs open in Python?

File() has been removed since Python 3.0 ...READ MORE

answered Oct 30, 2018 in Python by SDeb
• 13,300 points
0 votes
1 answer

How to write to CSV line by line in python

The simple way of doing this will ...READ MORE

answered Nov 15, 2018 in Python by findingbugs
• 3,260 points
0 votes
1 answer

Open file in Python

There is this code I used for ...READ MORE

answered Nov 16, 2018 in Python by Jino
• 5,820 points
0 votes
1 answer

Reducing sequences in an array of strings

I've written a C# app to solves ...READ MORE

answered Nov 2, 2018 in Others by DataKing99
• 8,240 points
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP