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.
i just realised that, changing the flag size, only changes the height and width attribute of the img
-tag. the image itself always has the same size and turns blurry if you set it higher.
this problem would be solved by using a vector format.
I know that only modern browsers support svg but maybe we can use the current images as a fallback somehow
Comment | File | Size | Author |
---|---|---|---|
#14 | languageicons_svg_icons-1343422-14.patch | 9.09 KB | Matroskeen |
Comments
Comment #1
loominade CreditAttribution: loominade commentedthere is actually a javascript based method to add a fallback:
Comment #2
Freso CreditAttribution: Freso commentedThis is actually quite an interesting prospect. This would also make it possible to "jack" almost all the flags straight from Wikipedia, without having to run them through my string of commands to make them PNG files first.
It's not going to make it into 7.x-1.x though, but for a future 7.x-2.x, it might be a possibility. I'll postpone it for now. Thank you for the suggestion though!
Comment #3
Freso CreditAttribution: Freso commentedHaving had this in the back of my mind for a few days, it turns out I actually really, really like the idea.
Is there any way, you know of, to load .png per default and switch to .svg if it's supported? Problem is, browsers that do not render SVGs are likely to not run JavaScript either. (I'm having e.g. "links -g" in mind.)
Comment #4
loominade CreditAttribution: loominade commentedI'm afraid there is no way to create a fallback or polyfill without javascript
Comment #5
Freso CreditAttribution: Freso commentedI think you may have misunderstood me. I wanted to use SVG as the "fallback", defaulting to PNG. If the browsers runs JavaScript and otherwise supports SVG images, then load the SVG instead of the PNG. Am I making sense or just on a late night ramble? :)
Comment #6
MatroskeenJust because svg it's cool :)
Tested on the latest release of Drupal 7 and 7.x-1.1 language icons branch.
Comment #8
MatroskeenLittle fix to make PHP 5.3 happy.
Comment #10
MatroskeenMore fixes to make PHP 5.3 happy.
Comment #12
Matroskeenlol :) let's remove this test at all :)
Comment #14
MatroskeenPHP 5.3 <3