Is there a way to apply the Image styles to the Filetype icon? Override the default icons?
I'm trying to create a view of searched files, and want to show images for each file. If they are an image, it will show a thumbnail, a video a preview mode, etc. If they are the generic "Other" filetype, it should just show the Filetype icon. However, instead of having it be 180x180 pixels, I'd like it to be the same size as my other thumbnails (176 x 132).
And when viewing the file attached to the node, I'd like to use the Filetype icon, but with a different size (320x240).
It would be great if we could run the default image icons through the image style filters to get the desired look and feel for a particular view.
Comment | File | Size | Author |
---|---|---|---|
#5 | file-icon-image-styles-1772496-5.patch | 4.58 KB | Devin Carlson |
#1 | search_results.png | 101.4 KB | chirhotec |
Comments
Comment #1
chirhotec CreditAttribution: chirhotec commentedExample image of how my file search looks now:
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commentedYou can customize the large file type icons by overriding
theme_media_formatter_large_icon()
(found in media/includes/media.theme.inc) in either your theme or custom module.Comment #4
P2790 CreditAttribution: P2790 commentedWould it possible to implement this, so that someone without php knowledge could change the filetype icon image style using entityviewmodes?
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedA patch to allow users to select an image style for the large filetype formatter.
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedTested #5 and committed to Media 7.x-2.x.
Comment #8
P2790 CreditAttribution: P2790 commentedThanks for that Devin, really helpful