- if ( !garmin_syms[i].icon &&
- ((vik_use_small_wp_icons && garmin_syms[i].data) ||
- (!vik_use_small_wp_icons && garmin_syms[i].data_large))) {
- garmin_syms[i].icon = gdk_pixbuf_from_pixdata (
- vik_use_small_wp_icons ? garmin_syms[i].data : garmin_syms[i].data_large,
- FALSE, NULL );
+ // Ensure data exists to either directly load icon or scale from the other set
+ if ( !garmin_syms[i].icon && ( garmin_syms[i].data || garmin_syms[i].data_large) ) {
+ if ( a_vik_get_use_large_waypoint_icons() ) {
+ if ( garmin_syms[i].data_large )
+ // Directly load icon
+ garmin_syms[i].icon = gdk_pixbuf_from_pixdata ( garmin_syms[i].data_large, FALSE, NULL );
+ else
+ // Up sample from small image
+ garmin_syms[i].icon = gdk_pixbuf_scale_simple ( gdk_pixbuf_from_pixdata ( garmin_syms[i].data, FALSE, NULL ), 30, 30, GDK_INTERP_BILINEAR );
+ }
+ else {
+ if ( garmin_syms[i].data )
+ // Directly use small symbol
+ garmin_syms[i].icon = gdk_pixbuf_from_pixdata ( garmin_syms[i].data, FALSE, NULL );
+ else
+ // Down size large image
+ garmin_syms[i].icon = gdk_pixbuf_scale_simple ( gdk_pixbuf_from_pixdata ( garmin_syms[i].data_large, FALSE, NULL ), 18, 18, GDK_INTERP_BILINEAR );
+ }