Jump to content

Filter result icons/thumbnails


Recommended Posts

Hello,

 

I've tried to search previous threads but was unable to find very much. I am curious about icon type fileicon in filter results. In the cases I've tried so far, I get only a generic icon; in limited testing, .jpg, .pdf, and .epub show only generic type icons. Perhaps some would depend on thumbnails from a quicklook plugin, yet for others if there is a Finder generated thumbnail, is that used? If needed, I could generate and cache my own thumbnails, and that may be necessary.

 

In default queries results outside of a workflow, file icon thumbnails would be wonderful as well, though perhaps that hasn't been implemented because of caching, performance, or some other reason.

 

There is also the question of aspect ratio. At least in some other workflows, I've noticed they are resized as a square; perhaps related to how the UIImage is currently generated. If needed, if I generate my own thumbnails, I could pad them, though it is possible to have Alfred resize while keeping aspect ratio.

Edited by h2ner
Link to comment

No media thumbnails or covers, only icons, I'm afraid.

 

Alfred resizes any icons that are too small/large. If they aren't square, they'll get squished to a square (or at least that's what Alfred did the last time I checked a few months ago).

 

Link to comment

hello deanishe,

 

I'm trying to understand then what constitutes an icon. I tried passing (large) .jpgs and saw generic file type icons. Currently looking through a few installed workflows, some use .png. If I need to generate PNGs or even icon files, I can, may, and likely will eventually do that. The docs, the last time I looked, weren't clear.

Link to comment

IIRC, Alfred accepts at least PNG, JPG, GIF and ICNS files. If a GIF is animated, only the first frame is shown.

 

I don't know for sure, but I can imagine Alfred would ignore large image files for performance reasons.

 

As a rule, images intended to be icons are square enough and small enough to pass to Alfred as-is. Other images tend to need processing in any case, as they're rarely square.

 

I usually go for 256px thumbnails, as that's the size Alfred itself uses when it creates a workflow's icon.png file.

Edited by deanishe
Link to comment

The info concerning dimensions of 256px is very helpful. Thank you deanishe. It is easy enough for me to experiment to find out when an icon is shown as is in place of an icon of filetype. I had only tried with large JPGs; and indeed perhaps it is determined by some size limit. If someday the workflow docs could be updated, as well as either a link or mention in your excellent alfred-workflow, that'd be terrific. :)


I'm unsure of the reasons why Andrew decided to resize images without keeping aspect ratio. If it is merely a question of not having looked into it, here is some info to save him a bit of time looking it up:

 

https://stackoverflow.com/questions/2531812/trying-to-resize-an-nsimage-which-turns-into-nsdata

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...