fix bug:239870

This commit is contained in:
sufang 2024-08-05 17:01:51 +08:00
parent 7130cf975d
commit fad3cdca2a
2 changed files with 29 additions and 6 deletions

View File

@ -288,18 +288,32 @@ Mat KylinImageCodec::loadFreeimageFormat(const char *filename)
Mat mat;
FIBITMAP *dib = NULL;
QFileInfo fi(QString::fromUtf8(filename));
QString suffix = fi.suffix();
QString file_suffix_lower = suffix.toLower();
QImageReader reader;
QImage res_qt;
reader.setFileName(QString(filename));
reader.setFormat(file_suffix_lower.toLatin1());
reader.setAutoTransform(true);
if(reader.imageCount() >= 0){
res_qt = reader.read();
if (res_qt.isNull()) {
qDebug()<<"获得图片格式失败或不支持此格式图片的读取";
return mat;
}
}
/* 获取文件格式 */
FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
fif = get_real_format(QString(filename));
if ((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) {
dib = FreeImage_Load(fif, filename, 0);
} else {
qDebug() << "获得图片格式失败或不支持此格式图片的读取";
}
if (dib != NULL) {
/* 将FIBITMAP转换成mat */
mat = FI2MAT(dib);
if (dib != NULL) {
mat = FI2MAT(dib);
}
FreeImage_Unload(dib);
} else {
qDebug() << "图像加载失败";

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
kylin-photo-viewer (1.3.0.3-ok22.24) nile; urgency=medium
* BUG号#239870 KVE-2024-0701
* 需求号:无
* 其他改动说明:无
* 影响域:无
-- sufang <sufang@kylinos.cn> Mon, 05 Aug 2024 16:59:10 +0800
kylin-photo-viewer (1.3.0.3-ok22.23) nile; urgency=medium
* BUG号#IAH7T6【gg-维哈柯】【次要】【看图】哈柯语言下,智能处理按钮悬浮和点击都显示为英文