{"comment":{"position":null,"created_at":"2011-10-14T22:44:53Z","body":"I didn't think of improving the method at the time - just extending what was there.\r\n\r\nIn fact the resizing is very simple and I can junk these two commits generating large and small pngs.\r\n\r\nIf only I did this way at the time - this change was a lot quicker to generate!\r\n\r\nThe key function becomes this:\r\n\r\n    static GdkPixbuf *get_wp_sym_from_index ( gint i ) {\r\n      // Ensure data exists to either directly load icon or scale from the other set\r\n      if ( !garmin_syms[i].icon && ( garmin_syms[i].data || garmin_syms[i].data_large) ) {\r\n        if ( a_vik_get_use_large_waypoint_icons() ) {\r\n          if ( garmin_syms[i].data_large )\r\n    \t// Directly use large symbol\r\n    \tgarmin_syms[i].icon = gdk_pixbuf_from_pixdata ( garmin_syms[i].data_large, FALSE, NULL );\r\n          else\r\n    \t// Up sample from small image\r\n    \tgarmin_syms[i].icon = gdk_pixbuf_scale_simple ( gdk_pixbuf_from_pixdata ( garmin_syms[i].data, FALSE, NULL ), 30, 30, GDK_INTERP_BILINEAR );\r\n        }\r\n        else {\r\n          if ( garmin_syms[i].data )\r\n    \t// Directly use small symbol\r\n    \tgarmin_syms[i].icon = gdk_pixbuf_from_pixdata ( garmin_syms[i].data, FALSE, NULL );\r\n         else\r\n    \t// Down size large image\r\n    \tgarmin_syms[i].icon = gdk_pixbuf_scale_simple ( gdk_pixbuf_from_pixdata ( garmin_syms[i].data_large, FALSE, NULL ), 18, 18, GDK_INTERP_BILINEAR );\r\n        }\r\n      }\r\n      return garmin_syms[i].icon;\r\n   } \r\n\r\nAnd then with a small adjustment in the a_get_hashed_sym function:\r\n\r\n    -    if ((!a_vik_get_use_large_waypoint_icons() && garmin_syms[i].data) ||\r\n    -        (a_vik_get_use_large_waypoint_icons() && garmin_syms[i].data_large)) {\r\n    +    // Ensure at least one symbol available - the other can be auto generated\r\n    +    if ( garmin_syms[i].data || garmin_syms[i].data_large ) {\r\n\r\nThen it's good to go. I'll put this into a proper patch sometime and probably shift it into the StagingPatches.","line":null,"commit_id":"1e68df9f0dd765e6668f5038447115c8a8279da3","updated_at":"2011-10-14T22:44:53Z","url":"https://api.github.com/repos/rnorris/viking/comments/653059","id":653059,"path":null,"user":{"gravatar_id":"c1362fc4b4a7bd566731206fcc8e6475","avatar_url":"https://secure.gravatar.com/avatar/c1362fc4b4a7bd566731206fcc8e6475?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/rnorris","id":105411,"login":"rnorris"}},"legacy":{"commit":"1e68df9f0dd765e6668f5038447115c8a8279da3","comment_id":653059}}