jlu5 / icoextract Goto Github PK
View Code? Open in Web Editor NEWExtract icons from Windows PE files (.exe/.dll)
Home Page: https://projects.jlu5.com/icoextract.html
License: MIT License
Extract icons from Windows PE files (.exe/.dll)
Home Page: https://projects.jlu5.com/icoextract.html
License: MIT License
Hello :)
Great project! It works damm well. But I have 1, no 2 problems:
The icons look like this, I'm 100% sure that this is not correct. The background is not transparent (problem 1) and some exe's have this strange looking standard icon (problem 2). Just take a look for yourself:
Besides this it's perfect! Thank you for your work, that really is a great project and should be installed by default if you install wine!
Best, Tim Gromeyer
Hi, I'm the AUR maintainer of icoextract. I just got notified that it has file conflicts with some other Python packages, notably python-confusables and python-baycomp, and I presume that others may be affected as well.
The error is specifically about site-packages/tests
, e.g.:
error: failed to commit transaction (conflicting files)
icoextract: /usr/lib/python3.10/site-packages/tests/__init__.py exists in filesystem (owned by python-confusables)
icoextract: /usr/lib/python3.10/site-packages/tests/__pycache__/__init__.cpython-310.opt-1.pyc exists in filesystem (owned by python-confusables)
icoextract: /usr/lib/python3.10/site-packages/tests/__pycache__/__init__.cpython-310.pyc exists in filesystem (owned by python-confusables)
What may be done to resolve such a conflict?
Do you plan to implement macOS support ?
Thanks.
The IconExtractor API is currently pretty small, but it'd be helpful to see usage instructions outlined more clearly.
https://wiki.python.org/moin/DocumentationTools has a bunch of examples. (I personally prefer Markdown over RST)
Hello, friend, this is a good program and it do help me.
But could you upload it to pypi? I hope to find a program that can pip install icoextract
and then icoextract src.exe dst.ico
.
Any way, thanks for your work!
In a previous issue #11, I said this:
Ok, yeah, all the icons for system libraries got moved to a new location in Windows 10 1903: https://superuser.com/questions/1480268/icons-no-longer-in-imageres-dll-in-windows-10-1903-4kb-file
I'm not sure if the new DLLs actually embed a reference to the .mun files, or if the system implicitly looks up the right file based on the DLL name. If the latter is true, there's not much icoextract can do other than make a guess.
My version of the C:\Windows\SystemResources\imageres.dll.mun file starts off with the magic bytes of "MZ", typically an executable or a .DLL
And with my second edit, I said, that I needed a different size of the icon. I want the icon to be 48x48 pixels in size, and here's the snippet:
import icoextract as icns
ext = icns.IconExtractor(r"C:\Windows\SystemResources\imageres.dll.mun")
ext.export_icon("foldIcon.ico", num=3)
print("Icon extracted successfully.")
foldIcon.ico
is currently 16x16 pixels in size, but I want it to be a 48x48 icon, to be as an PIL image. Can some help me?
Please add a new release for maintainers
Really need this commit in the release:
31ce309
Hello,
I am trying to use the Python library rather than the executable. Is it possible ? Is it documented ?
I wonder what data parameters are expected: icoextract.IconExtractor(icon_path, data=?)
:
class IconExtractor():
def __init__(self, filename=None, data=None):
...
Regards,
Jimmy
PS C:\> icolist -v C:\Windows\System32\wpdshext.dll
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "H:\Code\github\lgbatpy\.venv\Scripts\icolist.exe\__main__.py", line 7, in <module>
File "H:\Code\github\lgbatpy\.venv\Lib\site-packages\icoextract\scripts\icolist.py", line 20, in main
extractor = IconExtractor(args.input)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Code\github\lgbatpy\.venv\Lib\site-packages\icoextract\__init__.py", line 56, in __init__
raise NoIconsAvailableError("File has no group icon resources")
icoextract.NoIconsAvailableError: File has no group icon resources
It seems that the Pillow
isn't dependency for your pip
package โ before installing it the following error will occur:
ImportError: No module named PIL
After installing the Pillow
with the pip
tool, everything seems to work fine for me.
I believe you should add it as the dependency for your pip
package to make it less confusing for the newbies.
pefile.PE() can receive a data object, so i think we can let IconExtractor receive a file.read() data object too, it should be work
Code:
import icoextract as icns
ext = icns.IconExtractor(r"C:\Windows\System32\SHELL32.dll")
extractor.export_icon("foldIcon.ico", num=3)
print("Icon extracted successfully.")
Error:
- Traceback (most recent call last):
- File "C:\Users\user\Downloads\whistle\icns.py", line 3, in <module>
- ext = icns.IconExtractor(r"C:\Windows\System32\SHELL32.dll")
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "C:\Users\user\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\icoextract\__init__.py", line 56, in __init__
- raise NoIconsAvailableError("File has no group icon resources")
- icoextract.NoIconsAvailableError: File has no group icon resources
My export is more than 20 times less efficient than any other good app.
Command:
C:\waptdev\wapt-packages\oracle-java8-jre-nonfree\windows\x64>"C:\Program Files (x86)\wapt\Scripts\icoextract" "C:\Program Files\Java\jre-1.8\bin\java.exe" ".\WAPT\icon.png"
Have you any tips to improve efficiency of the exported image ?
PS: I see that #13 (comment) is what I need but in my opinion, it would be interesting to have a flag for sizing and make a light export by default with icoextract
pip3 install icoextract
followed by copying exe-thumbnailer.thumbnailer
into /usr/local/share/thumbnailers/ works fine for me on XFCE and Gnome, however on KDE/Dolphin this doesn't seem to do the trick.
Is there a different approach required or am I doing sth. wrong?
Hello,
I quickly try to generate a 48x48 maximal PNG
import icoextract
def main():
icoextract.generate_thumbnail(inputfile, outfile, large_size='<=48')
AttributeError: module 'icoextract' has no attribute 'generate_thumbnail'
What I am doing wrong, is it possible ? Will it work if a 48x47 size is found ?
Regards,
Jimmy
Some executables have custom icons for each size, with different amount of detail.
It would be nice if exe-thumbnailer would provide those different images depending on the zoom level of the file manager.
Currently, only the largest image is provided, which is then scaled down.
I'm on Fedora 36, and I've placed exe-thumbnailer.thumbnailer
into /usr/local/share/thumbnailers/
, but it keeps failing to generate icons for my EXE files. They always end up as a 1x1 PNG image in the fail
directory.
icoextract
and icolist
themselves work just fine and output correct PNG images.
Any idea what's wrong?
UPDATE: Turns out you have to install it as root or use a virtual environment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.