jlu5/icoextract

generate_thumbnail <= 48 pixels

Closed this issue · 1 comments

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

jlu5 commented

Sorry, this is straying offtopic into general Python support rather than any icoextract-specific question.

You cannot use the generate_thumbnail function because it's only part of the exe-thumbnailer script. The AttributeError you're seeing is because you're calling a function that doesn't exist in the library part of the code - i.e. it's not part of the API.

The exe-thumbnailer code is specific to the Linux thumbnailer, which by specification expects specific output icon sizes. If your requirements are different, you need to write your own ico->png conversion (and then there will not be any size restriction whatsoever).