diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 552c24045..9d171ad8a 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -868,7 +868,25 @@ void ExportDialog::slot_changeFilesExtension(bool force_extension) { // recupere le format a utiliser (acronyme et extension) QString format_acronym = epw -> exportProperties().format; QString format_extension = "." + format_acronym.toLower(); - + + // set maximum width / height according specifications of export-type + if (format_extension == ".bmp") { + foreach (auto line, diagram_lines_.values() ) { + line->width ->setRange(1, BMPmaxSize); + line->height->setRange(1, BMPmaxSize); + } + } else if (format_extension == ".jpg") { + foreach (auto line, diagram_lines_.values() ) { + line->width ->setRange(1, JPGmaxSize); + line->height->setRange(1, JPGmaxSize); + } + } else { + foreach (auto line, diagram_lines_.values() ) { + line->width ->setRange(1, GeneralMaxSize); + line->height->setRange(1, GeneralMaxSize); + } + } + // parcourt les schemas a exporter foreach(ExportDiagramLine *diagram_line, diagram_lines_.values()) { QString diagram_filename = diagram_line -> file_name -> text(); @@ -1008,16 +1026,16 @@ ExportDialog::ExportDiagramLine::ExportDiagramLine(Diagram *dia, QSize diagram_s file_name -> setMinimumWidth(280); width = new QSpinBox(); - width -> setRange(1, 100000); + width -> setRange(1, GeneralMaxSize); width -> setSuffix(tr("px")); width -> setValue(diagram_size.width()); height = new QSpinBox(); - height -> setRange(1, 100000); + height -> setRange(1, GeneralMaxSize); height -> setSuffix(tr("px")); height -> setValue(diagram_size.height()); - x_label = new QLabel("*"); + x_label = new QLabel("×"); keep_ratio = new QPushButton(); keep_ratio -> setCheckable(true); diff --git a/sources/exportdialog.h b/sources/exportdialog.h index b0b19602a..31bef13f3 100644 --- a/sources/exportdialog.h +++ b/sources/exportdialog.h @@ -79,6 +79,11 @@ class ExportDialog : public QDialog { QSignalMapper *reset_mapper_; QSignalMapper *clipboard_mapper_; + // constants for exporting images: + static const int BMPmaxSize = 32767; + static const int JPGmaxSize = 65535; + static const int GeneralMaxSize = 100000; + // project whose diagrams are to be exported QETProject *project_;