mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-15 11:14:18 -04:00
Compare commits
6 Commits
v6.6.0-rc1
...
v6.7.0
Author | SHA1 | Date | |
---|---|---|---|
fee0165bef | |||
ae641f7e94 | |||
46f7b90ce6 | |||
f7c8eaa140 | |||
36bfee8ae3 | |||
e2aaf89ec5 |
@ -1,11 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(KF_VERSION "6.6.0") # handled by release scripts
|
||||
set(KF_DEP_VERSION "6.6.0") # handled by release scripts
|
||||
set(KF_VERSION "6.7.0") # handled by release scripts
|
||||
set(KF_DEP_VERSION "6.7.0") # handled by release scripts
|
||||
project(KImageFormats VERSION ${KF_VERSION})
|
||||
|
||||
include(FeatureSummary)
|
||||
find_package(ECM 6.6.0 NO_MODULE)
|
||||
find_package(ECM 6.7.0 NO_MODULE)
|
||||
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
|
||||
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
|
||||
|
@ -136,7 +136,7 @@ public:
|
||||
}
|
||||
if (reader->supportsOption(QImageIOHandler::ImageTransformation)) {
|
||||
m_transformations = reader->transformation();
|
||||
if (m_transformations < 0 || m_transformations > 7)
|
||||
if (int(m_transformations) < 0 || int(m_transformations) > 7)
|
||||
ok = false;
|
||||
}
|
||||
return ok;
|
||||
|
@ -175,8 +175,8 @@ public:
|
||||
|
||||
// 32-bit
|
||||
if (IsEqualGUID(jxrfmt, GUID_PKPixelFormat32bppBGR)) {
|
||||
*conversionFormat = GUID_PKPixelFormat32bppRGB;
|
||||
return QImage::Format_RGBX8888; // Format_RGB32 (?)
|
||||
*conversionFormat = GUID_PKPixelFormat24bppRGB;
|
||||
return QImage::Format_RGB888;
|
||||
};
|
||||
if (IsEqualGUID(jxrfmt, GUID_PKPixelFormat32bppBGRA)) {
|
||||
*conversionFormat = GUID_PKPixelFormat32bppRGBA;
|
||||
@ -643,7 +643,7 @@ private:
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_Mono, GUID_PKPixelFormatBlackWhite)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_Grayscale8, GUID_PKPixelFormat8bppGray)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_Grayscale16, GUID_PKPixelFormat16bppGray)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_RGB555, GUID_PKPixelFormat16bppRGB565)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_RGB555, GUID_PKPixelFormat16bppRGB555)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_RGB16, GUID_PKPixelFormat16bppRGB565)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_BGR888, GUID_PKPixelFormat24bppBGR)
|
||||
<< std::pair<QImage::Format, PKPixelFormatGUID>(QImage::Format_RGB888, GUID_PKPixelFormat24bppRGB)
|
||||
|
@ -266,29 +266,30 @@ PCXHEADER::PCXHEADER()
|
||||
|
||||
bool peekHeader(QIODevice *d, PCXHEADER& h)
|
||||
{
|
||||
qint64 pos = 0;
|
||||
if (!d->isSequential()) {
|
||||
pos = d->pos();
|
||||
qint64 oldPos = d->pos();
|
||||
QByteArray head = d->read(sizeof(PCXHEADER));
|
||||
int readBytes = head.size();
|
||||
|
||||
if (d->isSequential()) {
|
||||
for (int pos = readBytes -1; pos >= 0; --pos) {
|
||||
d->ungetChar(head[pos]);
|
||||
}
|
||||
} else {
|
||||
d->seek(oldPos);
|
||||
}
|
||||
|
||||
if (readBytes < sizeof(PCXHEADER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto ok = false;
|
||||
{ // datastream is destroyed before working on device
|
||||
QDataStream ds(d);
|
||||
QDataStream ds(head);
|
||||
ds.setByteOrder(QDataStream::LittleEndian);
|
||||
ds >> h;
|
||||
ok = ds.status() == QDataStream::Ok && h.isValid();
|
||||
}
|
||||
|
||||
if (!d->isSequential()) {
|
||||
return d->seek(pos) && ok;
|
||||
}
|
||||
|
||||
// sequential device undo
|
||||
auto head = reinterpret_cast<char*>(&h);
|
||||
auto readBytes = sizeof(h);
|
||||
while (readBytes > 0) {
|
||||
d->ungetChar(head[readBytes-- - 1]);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
@ -806,12 +806,10 @@ QVariant RAWHandler::option(ImageOption option) const
|
||||
rawProcessor->imgdata.rawparams.shot_select = currentImageNumber();
|
||||
#endif
|
||||
if (rawProcessor->open_datastream(&stream) == LIBRAW_SUCCESS) {
|
||||
if (rawProcessor->unpack() == LIBRAW_SUCCESS) {
|
||||
auto w = libraw_get_iwidth(&rawProcessor->imgdata);
|
||||
auto h = libraw_get_iheight(&rawProcessor->imgdata);
|
||||
// flip & 4: taken from LibRaw code
|
||||
v = (rawProcessor->imgdata.sizes.flip & 4) ? QSize(h, w) : QSize(w, h);
|
||||
}
|
||||
auto w = libraw_get_iwidth(&rawProcessor->imgdata);
|
||||
auto h = libraw_get_iheight(&rawProcessor->imgdata);
|
||||
// flip & 4: taken from LibRaw code
|
||||
v = (rawProcessor->imgdata.sizes.flip & 4) ? QSize(h, w) : QSize(w, h);
|
||||
}
|
||||
d->rollbackTransaction();
|
||||
}
|
||||
|
Reference in New Issue
Block a user