Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be useful if the Drupal site could be configured to (optionally) cache profile images locally, and process them with imagecache. This would allow:
- local caching to minimize exposure to changing profile urls
- processing of twitter-hosted images to reduce size
- processing of twitter-hosted images to apply cosmetic changes to fit local theme (sepia, transparency, etc)
Comment | File | Size | Author |
---|---|---|---|
#9 | 1828732-theme_twitter_profile_image.patch | 3.63 KB | lyricnz |
Comments
Comment #1
lyricnz CreditAttribution: lyricnz commentedTo save reinventing the wheel, this is probably best done by
1) adding a twitter profile_image theme function (rather than theme_image)
2) (if imagecache_external) adding configuration for an imagecache profile to use
Comment #2
lyricnz CreditAttribution: lyricnz commentedHere's a patch that adds theme_twitter_profile_image(), which defaults to calling theme_image(). Both the views field handler and admin form are updated to use this new theme function.
If imagecache_external module is enabled, also adds a setting to the Twitter configuration page for a default Image style to use.
Attached a sample of this patch in use - to apply a silly red filter to profile images. Nice side-effects: width+height attributes added to output HTML,
Comment #3
lyricnz CreditAttribution: lyricnz commentedUpdated patch that allows configuration of the Image Style in the view field. And a screenshot of it in use, with two different Image styles, as an example.
Comment #4
13rac1 CreditAttribution: 13rac1 commentedPatch doesn't apply to current dev: 7.x-5.x-dev. Really close though. Looks good otherwise.
Comment #5
lyricnz CreditAttribution: lyricnz commentedReroll for 7.x-5.x.
Comment #6
lyricnz CreditAttribution: lyricnz commentedScreenshot of patch in action, applying rounded corners, and getting image width/height tags in the markup.
Comment #7
13rac1 CreditAttribution: 13rac1 commentedI know it is minor, but we can't introduce trailing whitespace. You should be able to strip them in your editor automatically.
Comment #8
lyricnz CreditAttribution: lyricnz commentedYeah, I rerolled the patch in vi on the train this morning, rather than my regular IDE. Will look at it when I get a chance from home.
Comment #9
lyricnz CreditAttribution: lyricnz commentedComment #10
Drave Robber CreditAttribution: Drave Robber commentedThe patch applies cleanly and makes sense, at least to my limited understanding of image processing. (I don't know enough of the stuff to RTBC though.)
Off-topic: just think of how bad whitespace issues would be if you were coding on a horse.
Comment #11
DamienMcKennaTriggering the testbot.
Comment #12
DamienMcKennaTriggering the testbot.
Comment #16
DamienMcKennaComment #17
DamienMcKenna