mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 08:09:39 +00:00
add tiff to supported image i/o format, fix #1068
This commit is contained in:
parent
19d0b86bdc
commit
df5d7c2d63
@ -30,6 +30,7 @@ class FileFormat
|
||||
{
|
||||
public:
|
||||
FileFormat(QString description, QString ex) : description(description), extensions(ex){}
|
||||
FileFormat(QString description, QStringList ex) : description(description), extensions(ex){}
|
||||
QString description;
|
||||
QStringList extensions;
|
||||
};
|
||||
|
||||
@ -1936,7 +1936,7 @@ bool MainWindow::importRaster(const QString& fileImg)
|
||||
|
||||
QStringList fileNameList;
|
||||
if (fileImg.isEmpty())
|
||||
fileNameList = QFileDialog::getOpenFileNames(this,tr("Import Mesh"), lastUsedDirectory.path(), PM.inputImageFormatListDialog().join(";;"));
|
||||
fileNameList = QFileDialog::getOpenFileNames(this,tr("Import Raster"), lastUsedDirectory.path(), PM.inputImageFormatListDialog().join(";;"));
|
||||
else
|
||||
fileNameList.push_back(fileImg);
|
||||
|
||||
|
||||
@ -71,19 +71,19 @@ class PMesh : public tri::TriMesh< vector<PVertex>, vector<PEdge>, vector<PFace>
|
||||
|
||||
const static std::list<FileFormat> importImageFormatList = {
|
||||
FileFormat("Windows Bitmap", "BMP"),
|
||||
FileFormat("Joint Photographic Experts Group", "JPG"),
|
||||
FileFormat("Joint Photographic Experts Group", "JPEG"),
|
||||
FileFormat("Joint Photographic Experts Group", {"JPG", "JPEG"}),
|
||||
FileFormat("Portable Network Graphics", "PNG"),
|
||||
FileFormat("Truevision Graphics Adapter", "TGA"),
|
||||
FileFormat("Tagged Image File Format", {"TIF", "TIFF"}),
|
||||
FileFormat("X11 Bitmap", "XBM"),
|
||||
FileFormat("X11 Bitmap", "XPM"),
|
||||
FileFormat("Truevision Graphics Adapter", "TGA")
|
||||
FileFormat("X11 Bitmap", "XPM")
|
||||
};
|
||||
|
||||
const static std::list<FileFormat> exportImageFormatList = {
|
||||
FileFormat("Windows Bitmap", "BMP"),
|
||||
FileFormat("Joint Photographic Experts Group", "JPG"),
|
||||
FileFormat("Joint Photographic Experts Group", "JPEG"),
|
||||
FileFormat("Joint Photographic Experts Group", {"JPG", "JPEG"}),
|
||||
FileFormat("Portable Network Graphics", "PNG"),
|
||||
FileFormat("Tagged Image File Format", {"TIF", "TIFF"}),
|
||||
FileFormat("X11 Bitmap", "XBM"),
|
||||
FileFormat("X11 Bitmap", "XPM")
|
||||
};
|
||||
@ -519,8 +519,10 @@ QImage BaseMeshIOPlugin::openImage(
|
||||
else { //check if it is a format supported natively by QImage
|
||||
bool supportedFormat = false;
|
||||
for (const FileFormat& f : importImageFormatList){
|
||||
if (f.extensions.first().toUpper() == format.toUpper())
|
||||
supportedFormat = true;
|
||||
for (const QString& ext : f.extensions){
|
||||
if (ext.toUpper() == format.toUpper())
|
||||
supportedFormat = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (supportedFormat) {
|
||||
@ -556,8 +558,10 @@ void BaseMeshIOPlugin::saveImage(
|
||||
{
|
||||
bool supportedFormat = false;
|
||||
for (const FileFormat& f : exportImageFormatList){
|
||||
if (f.extensions.first().toUpper() == format.toUpper())
|
||||
supportedFormat = true;
|
||||
for (const QString& ext : f.extensions){
|
||||
if (ext.toUpper() == format.toUpper())
|
||||
supportedFormat = true;
|
||||
}
|
||||
}
|
||||
if (supportedFormat){
|
||||
bool ok = image.save(fileName, nullptr, quality);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user