mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-19 09:01:18 +02:00
2022-11-09 Fred Gleason <fredg@paravelsystems.com>
* Added a file format check to the 'Image Manager' dialog in rdadmin(1) to ensure that only JPEG or PNG formatted image files can be imported. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -713,6 +713,19 @@ int RDFeed::importImageFile(const QString &pathname,QString *err_msg,
|
||||
QSize max=rda->rssSchemas()->maximumImageSize(rssSchema());
|
||||
*err_msg="OK";
|
||||
|
||||
//
|
||||
// Check the file type
|
||||
//
|
||||
QString mimetype=RDMimeType(pathname,&ok);
|
||||
if(!ok) {
|
||||
*err_msg=tr("Error validating image file.");
|
||||
return -1;
|
||||
}
|
||||
if((mimetype!="image/jpeg")&&(mimetype!="image/png")) {
|
||||
*err_msg=tr("Unsupported image file format.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
//
|
||||
// Load the image
|
||||
//
|
||||
|
Reference in New Issue
Block a user