diff --git a/source/ImageInterface.cpp b/source/ImageInterface.cpp index ce86ae4..a8e0e18 100644 --- a/source/ImageInterface.cpp +++ b/source/ImageInterface.cpp @@ -61,9 +61,12 @@ bool ImageInterface::loadFile( const QString &fileName ) { ConfigureFormatDialog formatDialog( this ); - if( formatDialog.exec() == QDialog::Rejected ) + if( m_currStream.needFormatDialog( fileName ) ) { - return false; + if( formatDialog.exec() == QDialog::Rejected ) + { + return false; + } } QApplication::setOverrideCursor( Qt::WaitCursor ); diff --git a/source/InputStream.cpp b/source/InputStream.cpp index 2015194..07d712e 100755 --- a/source/InputStream.cpp +++ b/source/InputStream.cpp @@ -119,6 +119,19 @@ QStringList InputStream::supportedPixelFormatList() return formats; } +Bool InputStream::needFormatDialog( QString filename ) +{ + QString fileExtension = QFileInfo(filename).completeSuffix(); + if( !fileExtension.compare( QString("yuv") ) ) + { + return true; + } + else + { + return false; + } +} + Void InputStream::init( QString filename, UInt width, UInt height, Int input_format ) { diff --git a/source/InputStream.h b/source/InputStream.h index 984236e..9687d23 100755 --- a/source/InputStream.h +++ b/source/InputStream.h @@ -90,6 +90,8 @@ public: YUVFormat = 0, // Use color space. }; + Bool needFormatDialog( QString filename ); + Void init( QString filename, UInt width, UInt height, Int input_format ); Void YUV420toRGB();