Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Slic3r/GUI.pm2
-rw-r--r--xs/src/slic3r/GUI/PresetBundle.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm
index 2dc560cad..a8799c458 100644
--- a/lib/Slic3r/GUI.pm
+++ b/lib/Slic3r/GUI.pm
@@ -112,7 +112,7 @@ sub OnInit {
$run_wizard = 1 if $self->{preset_bundle}->has_defauls_only;
# application frame
- Wx::Image::AddHandler(Wx::PNGHandler->new);
+ Wx::Image::FindHandlerType(wxBITMAP_TYPE_PNG) || Wx::Image::AddHandler(Wx::PNGHandler->new);
$self->{mainframe} = my $frame = Slic3r::GUI::MainFrame->new(
# If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden.
no_controller => $self->{app_config}->get('no_controller'),
diff --git a/xs/src/slic3r/GUI/PresetBundle.cpp b/xs/src/slic3r/GUI/PresetBundle.cpp
index b216cf70a..143e34e7f 100644
--- a/xs/src/slic3r/GUI/PresetBundle.cpp
+++ b/xs/src/slic3r/GUI/PresetBundle.cpp
@@ -34,7 +34,8 @@ PresetBundle::PresetBundle() :
m_bitmapCompatible(new wxBitmap),
m_bitmapIncompatible(new wxBitmap)
{
- ::wxInitAllImageHandlers();
+ if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr)
+ wxImage::AddHandler(new wxPNGHandler);
// Create the ID config keys, as they are not part of the Static print config classes.
this->prints.preset(0).config.opt_string("print_settings_id", true);