Show proper error if a GIF fails to open

pull/278/head
James H Ball 2025-01-14 20:04:46 +00:00
rodzic 67fb2961a5
commit 0d96f7d752
4 zmienionych plików z 17 dodań i 5 usunięć

Wyświetl plik

@ -84,6 +84,12 @@ bool CommonPluginEditor::keyPressed(const juce::KeyPress& key) {
saveProject();
} else if (key.getModifiers().isCommandDown() && key.getKeyCode() == 'O') {
openProject();
} else if (key.isKeyCode(juce::KeyPress::F11Key) && juce::JUCEApplicationBase::isStandaloneApp()) {
// set fullscreen
juce::StandaloneFilterWindow* window = findParentComponentOfClass<juce::StandaloneFilterWindow>();
if (window != nullptr) {
window->setFullScreen(!fullScreen);
}
}
return false;

Wyświetl plik

@ -25,6 +25,7 @@ public:
private:
CommonAudioProcessor& audioProcessor;
bool fullScreen = false;
juce::File applicationFolder = juce::File::getSpecialLocation(juce::File::SpecialLocationType::userApplicationDataDirectory)
#if JUCE_MAC

Wyświetl plik

@ -66,6 +66,16 @@ ImageParser::ImageParser(OscirenderAudioProcessor& p, juce::String extension, ju
}
}
}
if (frames.size() == 0) {
juce::MessageManager::callAsync([this] {
juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::AlertIconType::WarningIcon, "Invalid GIF", "The image could not be loaded. Please try optimising the GIF with https://ezgif.com/optimize.");
});
width = 1;
height = 1;
frames.emplace_back(std::vector<uint8_t>(1));
}
setFrame(0);
}

Wyświetl plik

@ -361,11 +361,6 @@ bool VisualiserComponent::keyPressed(const juce::KeyPress& key) {
} else if (key.isKeyCode(juce::KeyPress::spaceKey)) {
setPaused(active);
return true;
} else if (key.isKeyCode(juce::KeyPress::F11Key)) {
// set fullscreen
juce::Component* component = juce::TopLevelWindow::getTopLevelWindow(0);
juce::Desktop::getInstance().setKioskModeComponent(component, true);
return true;
}
return false;