Skip to content
Snippets Groups Projects
Unverified Commit 58b4d7aa authored by YU LIU's avatar YU LIU Committed by GitHub
Browse files

Disable the generation of empty RGB images

parent 27f06728
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,19 @@ void ColorimetryOp::operator()(const imagein::Image*, const std::map<const image
QDialog::DialogCode code = static_cast<QDialog::DialogCode>(dialog->exec());
QColor color = dialog->getColor();
if(code!=QDialog::Accepted) return;
if(dialog->getWidth()==0 || dialog->getHeight()==0){
QMessageBox *msgBox;
msgBox = new QMessageBox(QObject::tr("Warning"),
QObject::tr(" Empty image creation is not allowed "),
QMessageBox::Warning,
QMessageBox::Ok | QMessageBox::Default,
QMessageBox::NoRole | QMessageBox::Escape,
0);
msgBox->show();
return;
}
Image* resImg = new Image(dialog->getWidth(), dialog->getHeight(), 3);
for(unsigned int j = 0; j < resImg->getHeight(); ++j) {
for(unsigned int i = 0; i < resImg->getWidth(); ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment