Skip to content

Commit

Permalink
Remove PNG icons from the classic icon set (openhab#2084)
Browse files Browse the repository at this point in the history
The docker environment is (unfortunately) kept. It can be used to
compress SVG files. Conversion from SVG into PNG format has been
commented in the script .convert.sh.

Closes openhab#2071
Closes openhab#1768

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored Nov 13, 2023
1 parent 751f7a8 commit dfbdcf2
Show file tree
Hide file tree
Showing 398 changed files with 20 additions and 78 deletions.
16 changes: 8 additions & 8 deletions bundles/org.openhab.ui.iconset.classic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is a modernized version of the original icon set from openHAB 1.x.
The set is provided with the distribution in both the PNG and SVG file format.

{% assign allIconsStr = "alarm.png,attic.png,baby_1.png,baby_2.png,baby_3.png,baby_4.png,baby_5.png,baby_6.png,bath.png,battery.png,batterylevel.png,batterylevel-0.png,batterylevel-10.png,batterylevel-20.png,batterylevel-30.png,batterylevel-40.png,batterylevel-50.png,batterylevel-60.png,batterylevel-70.png,batterylevel-80.png,batterylevel-90.png,batterylevel-100.png,battery-0.png,battery-10.png,battery-20.png,battery-30.png,battery-40.png,battery-50.png,battery-60.png,battery-70.png,battery-80.png,battery-90.png,battery-100.png,bedroom.png,bedroom_blue.png,bedroom_orange.png,bedroom_red.png,blinds.png,blinds-0.png,blinds-10.png,blinds-20.png,blinds-30.png,blinds-40.png,blinds-50.png,blinds-60.png,blinds-70.png,blinds-80.png,blinds-90.png,blinds-100.png,bluetooth.png,boy_1.png,boy_2.png,boy_3.png,boy_4.png,boy_5.png,boy_6.png,calendar.png,camera.png,carbondioxide.png,cellar.png,chart.png,cinema.png,cinemascreen.png,cinemascreen-0.png,cinemascreen-10.png,cinemascreen-20.png,cinemascreen-30.png,cinemascreen-40.png,cinemascreen-50.png,cinemascreen-60.png,cinemascreen-70.png,cinemascreen-80.png,cinemascreen-90.png,cinemascreen-100.png,cistern.png,cistern-0.png,cistern-10.png,cistern-20.png,cistern-30.png,cistern-40.png,cistern-50.png,cistern-60.png,cistern-70.png,cistern-80.png,cistern-90.png,cistern-100.png,climate.png,climate-on.png,colorlight.png,colorpicker.png,colorwheel.png,contact.png,contact-ajar.png,contact-closed.png,contact-open.png,corridor.png,door.png,door-closed.png,door-open.png,dryer.png,dryer-0.png,dryer-1.png,dryer-2.png,dryer-3.png,dryer-4.png,dryer-5.png,energy.png,error.png,fan.png,fan_box.png,fan_ceiling.png,faucet.png,fire.png,fire-off.png,fire-on.png,firstfloor.png,flow.png,flowpipe.png,frontdoor.png,frontdoor-closed.png,frontdoor-open.png,garage.png,garagedoor.png,garagedoor-0.png,garagedoor-10.png,garagedoor-20.png,garagedoor-30.png,garagedoor-40.png,garagedoor-50.png,garagedoor-60.png,garagedoor-70.png,garagedoor-80.png,garagedoor-90.png,garagedoor-100.png,garagedoor-ajar.png,garagedoor-closed.png,garagedoor-open.png,garage_detached.png,garage_detached_selected.png,garden.png,gas.png,girl_1.png,girl_2.png,girl_3.png,girl_4.png,girl_5.png,girl_6.png,greenhouse.png,groundfloor.png,group.png,heating.png,heating-0.png,heating-20.png,heating-40.png,heating-60.png,heating-80.png,heating-100.png,heating-off.png,heating-on.png,house.png,humidity.png,humidity-0.png,humidity-10.png,humidity-20.png,humidity-30.png,humidity-40.png,humidity-50.png,humidity-60.png,humidity-70.png,humidity-80.png,humidity-90.png,humidity-100.png,incline.png,keyring.png,kitchen.png,lawnmower.png,light.png,lightbulb.png,light-0.png,light-10.png,light-20.png,light-30.png,light-40.png,light-50.png,light-60.png,light-70.png,light-80.png,light-90.png,light-100.png,light-off.png,light-on.png,line.png,line-decline.png,line-incline.png,line-stagnation.png,lock.png,lock-closed.png,lock-open.png,lowbattery.png,lowbattery-off.png,lowbattery-on.png,man_1.png,man_2.png,man_3.png,man_4.png,man_5.png,man_6.png,mediacontrol.png,microphone.png,moon.png,motion.png,movecontrol.png,network.png,network-off.png,network-on.png,niveau.png,office.png,oil.png,outdoorlight.png,pantry.png,parents-off.png,parents_1_1.png,parents_1_2.png,parents_1_3.png,parents_1_4.png,parents_1_5.png,parents_1_6.png,parents_2_1.png,parents_2_2.png,parents_2_3.png,parents_2_4.png,parents_2_5.png,parents_2_6.png,parents_3_1.png,parents_3_2.png,parents_3_3.png,parents_3_4.png,parents_3_5.png,parents_3_6.png,parents_4_1.png,parents_4_2.png,parents_4_3.png,parents_4_4.png,parents_4_5.png,parents_4_6.png,parents_5_1.png,parents_5_2.png,parents_5_3.png,parents_5_4.png,parents_5_5.png,parents_5_6.png,parents_6_1.png,parents_6_2.png,parents_6_3.png,parents_6_4.png,parents_6_5.png,parents_6_6.png,party.png,pie.png,piggybank.png,player.png,poweroutlet.png,poweroutlet-off.png,poweroutlet-on.png,poweroutlet_au.png,poweroutlet_eu.png,poweroutlet_uk.png,poweroutlet_us.png,presence.png,presence-off.png,pressure.png,price.png,projector.png,pump.png,qualityofservice.png,qualityofservice-0.png,qualityofservice-1.png,qualityofservice-2.png,qualityofservice-3.png,qualityofservice-4.png,radiator.png,rain.png,receiver.png,receiver-off.png,receiver-on.png,recorder.png,returnpipe.png,rgb.png,rollershutter.png,rollershutter-0.png,rollershutter-10.png,rollershutter-20.png,rollershutter-30.png,rollershutter-40.png,rollershutter-50.png,rollershutter-60.png,rollershutter-70.png,rollershutter-80.png,rollershutter-90.png,rollershutter-100.png,screen.png,screen-off.png,screen-on.png,settings.png,sewerage.png,sewerage-0.png,sewerage-10.png,sewerage-20.png,sewerage-30.png,sewerage-40.png,sewerage-50.png,sewerage-60.png,sewerage-70.png,sewerage-80.png,sewerage-90.png,sewerage-100.png,shield.png,shield-0.png,shield-1.png,siren.png,siren-off.png,siren-on.png,slider.png,slider-0.png,slider-10.png,slider-20.png,slider-30.png,slider-40.png,slider-50.png,slider-60.png,slider-70.png,slider-80.png,slider-90.png,slider-100.png,smiley.png,smoke.png,snow.png,sofa.png,softener.png,solarplant.png,soundvolume.png,soundvolume-0.png,soundvolume-33.png,soundvolume-66.png,soundvolume-100.png,soundvolume_mute.png,status.png,suitcase.png,sun.png,sunrise.png,sunset.png,sun_clouds.png,switch.png,switch-off.png,switch-on.png,temperature.png,temperature_cold.png,temperature_hot.png,terrace.png,text.png,time.png,time-on.png,toilet.png,vacation.png,video.png,wallswitch.png,wallswitch-off.png,wallswitch-on.png,wardrobe.png,washingmachine.png,washingmachine_2.png,washingmachine_2-0.png,washingmachine_2-1.png,washingmachine_2-2.png,washingmachine_2-3.png,water.png,whitegood.png,wind.png,window.png,window-ajar.png,window-closed.png,window-open.png,woman_1.png,woman_2.png,woman_3.png,woman_4.png,woman_5.png,woman_6.png,zoom.png," %}
{% assign allIconsStr = "alarm.svg,attic.svg,baby_1.svg,baby_2.svg,baby_3.svg,baby_4.svg,baby_5.svg,baby_6.svg,bath.svg,battery.svg,batterylevel.svg,batterylevel-0.svg,batterylevel-10.svg,batterylevel-20.svg,batterylevel-30.svg,batterylevel-40.svg,batterylevel-50.svg,batterylevel-60.svg,batterylevel-70.svg,batterylevel-80.svg,batterylevel-90.svg,batterylevel-100.svg,battery-0.svg,battery-10.svg,battery-20.svg,battery-30.svg,battery-40.svg,battery-50.svg,battery-60.svg,battery-70.svg,battery-80.svg,battery-90.svg,battery-100.svg,bedroom.svg,bedroom_blue.svg,bedroom_orange.svg,bedroom_red.svg,blinds.svg,blinds-0.svg,blinds-10.svg,blinds-20.svg,blinds-30.svg,blinds-40.svg,blinds-50.svg,blinds-60.svg,blinds-70.svg,blinds-80.svg,blinds-90.svg,blinds-100.svg,bluetooth.svg,boy_1.svg,boy_2.svg,boy_3.svg,boy_4.svg,boy_5.svg,boy_6.svg,calendar.svg,camera.svg,carbondioxide.svg,cellar.svg,chart.svg,cinema.svg,cinemascreen.svg,cinemascreen-0.svg,cinemascreen-10.svg,cinemascreen-20.svg,cinemascreen-30.svg,cinemascreen-40.svg,cinemascreen-50.svg,cinemascreen-60.svg,cinemascreen-70.svg,cinemascreen-80.svg,cinemascreen-90.svg,cinemascreen-100.svg,cistern.svg,cistern-0.svg,cistern-10.svg,cistern-20.svg,cistern-30.svg,cistern-40.svg,cistern-50.svg,cistern-60.svg,cistern-70.svg,cistern-80.svg,cistern-90.svg,cistern-100.svg,climate.svg,climate-on.svg,colorlight.svg,colorpicker.svg,colorwheel.svg,contact.svg,contact-ajar.svg,contact-closed.svg,contact-open.svg,corridor.svg,door.svg,door-closed.svg,door-open.svg,dryer.svg,dryer-0.svg,dryer-1.svg,dryer-2.svg,dryer-3.svg,dryer-4.svg,dryer-5.svg,energy.svg,error.svg,fan.svg,fan_box.svg,fan_ceiling.svg,faucet.svg,fire.svg,fire-off.svg,fire-on.svg,firstfloor.svg,flow.svg,flowpipe.svg,frontdoor.svg,frontdoor-closed.svg,frontdoor-open.svg,garage.svg,garagedoor.svg,garagedoor-0.svg,garagedoor-10.svg,garagedoor-20.svg,garagedoor-30.svg,garagedoor-40.svg,garagedoor-50.svg,garagedoor-60.svg,garagedoor-70.svg,garagedoor-80.svg,garagedoor-90.svg,garagedoor-100.svg,garagedoor-ajar.svg,garagedoor-closed.svg,garagedoor-open.svg,garage_detached.svg,garage_detached_selected.svg,garden.svg,gas.svg,girl_1.svg,girl_2.svg,girl_3.svg,girl_4.svg,girl_5.svg,girl_6.svg,greenhouse.svg,groundfloor.svg,group.svg,heating.svg,heating-0.svg,heating-20.svg,heating-40.svg,heating-60.svg,heating-80.svg,heating-100.svg,heating-off.svg,heating-on.svg,house.svg,humidity.svg,humidity-0.svg,humidity-10.svg,humidity-20.svg,humidity-30.svg,humidity-40.svg,humidity-50.svg,humidity-60.svg,humidity-70.svg,humidity-80.svg,humidity-90.svg,humidity-100.svg,incline.svg,keyring.svg,kitchen.svg,lawnmower.svg,light.svg,lightbulb.svg,light-0.svg,light-10.svg,light-20.svg,light-30.svg,light-40.svg,light-50.svg,light-60.svg,light-70.svg,light-80.svg,light-90.svg,light-100.svg,light-off.svg,light-on.svg,line.svg,line-decline.svg,line-incline.svg,line-stagnation.svg,lock.svg,lock-closed.svg,lock-open.svg,lowbattery.svg,lowbattery-off.svg,lowbattery-on.svg,man_1.svg,man_2.svg,man_3.svg,man_4.svg,man_5.svg,man_6.svg,mediacontrol.svg,microphone.svg,moon.svg,motion.svg,movecontrol.svg,network.svg,network-off.svg,network-on.svg,niveau.svg,office.svg,oil.svg,outdoorlight.svg,pantry.svg,parents-off.svg,parents_1_1.svg,parents_1_2.svg,parents_1_3.svg,parents_1_4.svg,parents_1_5.svg,parents_1_6.svg,parents_2_1.svg,parents_2_2.svg,parents_2_3.svg,parents_2_4.svg,parents_2_5.svg,parents_2_6.svg,parents_3_1.svg,parents_3_2.svg,parents_3_3.svg,parents_3_4.svg,parents_3_5.svg,parents_3_6.svg,parents_4_1.svg,parents_4_2.svg,parents_4_3.svg,parents_4_4.svg,parents_4_5.svg,parents_4_6.svg,parents_5_1.svg,parents_5_2.svg,parents_5_3.svg,parents_5_4.svg,parents_5_5.svg,parents_5_6.svg,parents_6_1.svg,parents_6_2.svg,parents_6_3.svg,parents_6_4.svg,parents_6_5.svg,parents_6_6.svg,party.svg,pie.svg,piggybank.svg,player.svg,poweroutlet.svg,poweroutlet-off.svg,poweroutlet-on.svg,poweroutlet_au.svg,poweroutlet_eu.svg,poweroutlet_uk.svg,poweroutlet_us.svg,presence.svg,presence-off.svg,pressure.svg,price.svg,projector.svg,pump.svg,qualityofservice.svg,qualityofservice-0.svg,qualityofservice-1.svg,qualityofservice-2.svg,qualityofservice-3.svg,qualityofservice-4.svg,radiator.svg,rain.svg,receiver.svg,receiver-off.svg,receiver-on.svg,recorder.svg,returnpipe.svg,rgb.svg,rollershutter.svg,rollershutter-0.svg,rollershutter-10.svg,rollershutter-20.svg,rollershutter-30.svg,rollershutter-40.svg,rollershutter-50.svg,rollershutter-60.svg,rollershutter-70.svg,rollershutter-80.svg,rollershutter-90.svg,rollershutter-100.svg,screen.svg,screen-off.svg,screen-on.svg,settings.svg,sewerage.svg,sewerage-0.svg,sewerage-10.svg,sewerage-20.svg,sewerage-30.svg,sewerage-40.svg,sewerage-50.svg,sewerage-60.svg,sewerage-70.svg,sewerage-80.svg,sewerage-90.svg,sewerage-100.svg,shield.svg,shield-0.svg,shield-1.svg,siren.svg,siren-off.svg,siren-on.svg,slider.svg,slider-0.svg,slider-10.svg,slider-20.svg,slider-30.svg,slider-40.svg,slider-50.svg,slider-60.svg,slider-70.svg,slider-80.svg,slider-90.svg,slider-100.svg,smiley.svg,smoke.svg,snow.svg,sofa.svg,softener.svg,solarplant.svg,soundvolume.svg,soundvolume-0.svg,soundvolume-33.svg,soundvolume-66.svg,soundvolume-100.svg,soundvolume_mute.svg,status.svg,suitcase.svg,sun.svg,sunrise.svg,sunset.svg,sun_clouds.svg,switch.svg,switch-off.svg,switch-on.svg,temperature.svg,temperature_cold.svg,temperature_hot.svg,terrace.svg,text.svg,time.svg,time-on.svg,toilet.svg,vacation.svg,video.svg,wallswitch.svg,wallswitch-off.svg,wallswitch-on.svg,wardrobe.svg,washingmachine.svg,washingmachine_2.svg,washingmachine_2-0.svg,washingmachine_2-1.svg,washingmachine_2-2.svg,washingmachine_2-3.svg,water.svg,whitegood.svg,wind.svg,window.svg,window-ajar.svg,window-closed.svg,window-open.svg,woman_1.svg,woman_2.svg,woman_3.svg,woman_4.svg,woman_5.svg,woman_6.svg,zoom.svg," %}
{% assign allIcons = allIconsStr | split: ',' %}

{% for icon in allIcons %}
Expand All @@ -25,10 +25,10 @@ The set is provided with the distribution in both the PNG and SVG file format.
{% for category in placesCategoryNames %}
{% assign iconSrc = base | append: "/img/icon_no_category.png" %}
{% if allIconsWithoutExtension contains category %}
{% assign iconSrc = "icons/" | append: category | append: ".png" %}
{% assign iconSrc = "icons/" | append: category | append: ".svg" %}
{% endif %}
<figure>
<img src="{{iconSrc}}" alt="{{category}}" title="{{category}}">
<img src="{{iconSrc}}" alt="{{category}}" title="{{category}}" width="64" height="64">
<figcaption>{{category}}</figcaption>
</figure>
{% endfor %}
Expand All @@ -46,7 +46,7 @@ The set is provided with the distribution in both the PNG and SVG file format.
{% for category in thingCategoryNames %}
{% assign iconSrc = base | append: "/img/icon_no_category.png" %}
{% if allIconsWithoutExtension contains category %}
{% assign iconSrc = "icons/" | append: category | append: ".png" %}
{% assign iconSrc = "icons/" | append: category | append: ".svg" %}
{% endif %}

{% assign altText = "" %}
Expand All @@ -58,7 +58,7 @@ The set is provided with the distribution in both the PNG and SVG file format.
{% endif %}
{% endfor %}
<figure>
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}">
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}" width="64" height="64">
<figcaption>{{category}}</figcaption>
</figure>
{% endfor %}
Expand Down Expand Up @@ -88,7 +88,7 @@ The set is provided with the distribution in both the PNG and SVG file format.
{% for channelCategory in channelCategoryNames %}
{% assign iconSrc = base | append: "/img/icon_no_category.png" %}
{% if allIconsWithoutExtension contains channelCategory %}
{% assign iconSrc = "icons/" | append: channelCategory | append: ".png" %}
{% assign iconSrc = "icons/" | append: channelCategory | append: ".svg" %}
{% endif %}

{% assign altText = "" %}
Expand All @@ -101,7 +101,7 @@ The set is provided with the distribution in both the PNG and SVG file format.
{% endfor %}

<figure>
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}">
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}" width="64" height="64">
<figcaption>{{channelCategory}}</figcaption>
</figure>
{% endfor %}
Expand Down Expand Up @@ -145,7 +145,7 @@ The set is provided with the distribution in both the PNG and SVG file format.
{% endfor %}

<figure>
<img src="icons/{{icon}}" alt="{{altText}}" title="{{altText}}">
<img src="icons/{{icon}}" alt="{{altText}}" title="{{altText}}" width="64" height="64">
<figcaption>{{plainCategory}}</figcaption>
</figure>
{% endunless %}
Expand Down
16 changes: 8 additions & 8 deletions bundles/org.openhab.ui.iconset.classic/README.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The set is provided with the distribution in both the PNG and SVG file format.
EOF

for icon in $(ls icons/*.png | sort -V); do
for icon in $(ls icons/*.svg | sort -V); do
name=$(basename "$icon")
echo "Adding icon '$name'"
if [ "$name" = "none.png" ] || [ "$name" = "none.svg" ]; then continue; fi
Expand Down Expand Up @@ -42,10 +42,10 @@ cat <<EOF >> "$READMEMD"
{% for category in placesCategoryNames %}
{% assign iconSrc = base | append: "/img/icon_no_category.png" %}
{% if allIconsWithoutExtension contains category %}
{% assign iconSrc = "icons/" | append: category | append: ".png" %}
{% assign iconSrc = "icons/" | append: category | append: ".svg" %}
{% endif %}
<figure>
<img src="{{iconSrc}}" alt="{{category}}" title="{{category}}">
<img src="{{iconSrc}}" alt="{{category}}" title="{{category}}" width="64" height="64">
<figcaption>{{category}}</figcaption>
</figure>
{% endfor %}
Expand All @@ -63,7 +63,7 @@ cat <<EOF >> "$READMEMD"
{% for category in thingCategoryNames %}
{% assign iconSrc = base | append: "/img/icon_no_category.png" %}
{% if allIconsWithoutExtension contains category %}
{% assign iconSrc = "icons/" | append: category | append: ".png" %}
{% assign iconSrc = "icons/" | append: category | append: ".svg" %}
{% endif %}
{% assign altText = "" %}
Expand All @@ -75,7 +75,7 @@ cat <<EOF >> "$READMEMD"
{% endif %}
{% endfor %}
<figure>
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}">
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}" width="64" height="64">
<figcaption>{{category}}</figcaption>
</figure>
{% endfor %}
Expand Down Expand Up @@ -105,7 +105,7 @@ cat <<EOF >> "$READMEMD"
{% for channelCategory in channelCategoryNames %}
{% assign iconSrc = base | append: "/img/icon_no_category.png" %}
{% if allIconsWithoutExtension contains channelCategory %}
{% assign iconSrc = "icons/" | append: channelCategory | append: ".png" %}
{% assign iconSrc = "icons/" | append: channelCategory | append: ".svg" %}
{% endif %}
{% assign altText = "" %}
Expand All @@ -118,7 +118,7 @@ cat <<EOF >> "$READMEMD"
{% endfor %}
<figure>
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}">
<img src="{{iconSrc}}" alt="{{altText}}" title="{{altText}}" width="64" height="64">
<figcaption>{{channelCategory}}</figcaption>
</figure>
{% endfor %}
Expand Down Expand Up @@ -162,7 +162,7 @@ cat <<EOF >> "$READMEMD"
{% endfor %}
<figure>
<img src="icons/{{icon}}" alt="{{altText}}" title="{{altText}}">
<img src="icons/{{icon}}" alt="{{altText}}" title="{{altText}}" width="64" height="64">
<figcaption>{{plainCategory}}</figcaption>
</figure>
{% endunless %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.io.InputStream;
import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;

Expand Down Expand Up @@ -60,9 +59,7 @@ public ClassicIconProvider(final BundleContext context, final @Reference Transla

@Override
public Set<IconSet> getIconSets(@Nullable Locale locale) {
Set<Format> formats = new HashSet<>(2);
formats.add(Format.PNG);
formats.add(Format.SVG);
Set<Format> formats = Set.of(Format.SVG);

String label = i18nProvider.getText(context.getBundle(), "iconset.label", DEFAULT_LABEL, locale);
label = label == null ? DEFAULT_LABEL : label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ for SVG_FILE in "${FILES[@]}"; do
printf "(%d/%d): %s\n" "$I" "$TOTAL" "$SVG_FILE"
print_separator "="
scour_compression "$SVG_FILE"
svg2png_conversion "$SVG_FILE" "$PNG_FILE"
optipng_conpression "$PNG_FILE"
pngquant_compression "$PNG_FILE"
# svg2png_conversion "$SVG_FILE" "$PNG_FILE"
# optipng_conpression "$PNG_FILE"
# pngquant_compression "$PNG_FILE"
printf '\n'
done

Expand Down
Loading

0 comments on commit dfbdcf2

Please sign in to comment.