Commit Graph

163 Commits

Author SHA1 Message Date
Albert Astals Cid
bff6142b44 xcf: initialize num_colors 2019-01-27 13:07:37 +01:00
Albert Astals Cid
09abfd8084 xcf: Initialize layer visible property
https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt says
	When reading old XCF files that lack this property, assume that layers are visible
2019-01-27 13:03:51 +01:00
Albert Astals Cid
964624ba40 xcf: Don't cast int to enum that can't hold that int value 2019-01-27 12:50:19 +01:00
Albert Astals Cid
3dee6f7c47 xcf: Do not overflow int on the setDotsPerMeterX/Y call 2019-01-27 12:29:07 +01:00
Albert Astals Cid
b8cb5e322c delete copy constructor and assignment operator of some internal classes
they are unused, but if anyone would use them things would go wrong, so protect us from it
2019-01-13 22:30:55 +01:00
Yuri Chornoivan
8ac949d459 Fix minor EBN issues 2018-10-22 19:58:24 +03:00
David Faure
f485719012 kimg_rgb: optimize away QRegExp and QString::fromLocal8Bit.
Summary:
The code is even simpler this way.

Found by using heaptrack.

Test Plan: the unittest for rgb still passes.

Reviewers: cfeck

Reviewed By: cfeck

Subscribers: jtamate, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15890
2018-10-03 00:51:29 +02:00
Friedrich W. H. Kossebau
1db1b94657 [EPS] qWarning -> qCWarning 2018-09-17 11:56:58 +02:00
Friedrich W. H. Kossebau
98c65a438d [EPS] Fix crash at app shutdown (being tried to persist clipboard image)
Summary:
Deny any capabilities when there is no QApp instance.

BUG: 397040

Test Plan:
Untested, as I do not experience the bug on my system and had no time to
invest into trying to.

Reviewers: zccrs, dfaure, pino

Reviewed By: dfaure

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15405
2018-09-17 11:54:18 +02:00
Laurent Montel
67a84f459d Use override 2018-06-12 07:01:11 +02:00
Alexander Volkov
813a7bdddb Remove duplicated mime types from json files
Qt expects a bijection between keys and mime types.
2018-05-25 14:32:11 +03:00
Laurent Montel
a4d1f4db1d Use override 2018-05-23 08:06:50 +02:00
Christoph Feck
19f33239e7 [XCF/GIMP loader] Raise maximimum allowed image size to 32767x32767 on 64 bit platforms
The GIMP image loader had a limit to 16K x 16K pixels, because this would
already exhaust the 2 GByte address space limit of 32 bit systems.

Remove this limit on 64 bit systems to allow the full 32K x 32K size.

BUG: 391970

Differential Revision: https://phabricator.kde.org/D12557
2018-05-02 02:10:26 +02:00
Laurent Montel
698ba297d3 We depend against 5.8.0 now 2018-03-27 08:01:04 +02:00
Laurent Montel
e5b226e804 Remove not necessary QtCore and co 2018-03-11 13:49:26 +01:00
Friedrich W. H. Kossebau
7aa5333a3f kcoreaddons_add_plugin: remove effectless OBJECT_DEPENDS on json file
The JSON file argument is passed to Q_PLUGIN_METADATA, which is a no-code
macro at the C++ level and only used to note information used by moc
for the generated moc file.

So when the content of the JSON file has changed, this will not change
anything in the preprocessed source file itself. It only has an effect on
the content of the moc file generated based on it, which is either included
and thus already triggers a dependecy or generated by automoc and compiled
separately into the target with the needed dependencies.

It is automoc which needs to properly trigger a recreation of the moc
file when checking the sources (and at least in 3.9 & 10 does),
and this is nothing that can be influenced by dependency rules.
2018-02-23 19:09:18 +01:00
David Faure
04e2ee01cb Set LIBRARY_OUTPUT_DIRECTORY so the autotests can run without the plugins installed
Do this properly by defining a function (inspired by kcoreaddons_add_plugin)
2018-01-05 11:19:18 +01:00
Martin Koller
7f2c44add4 Use brace-initializer instead of nullptr in returning 0-QFlags
Differential Revision: https://phabricator.kde.org/D9182
2017-12-05 19:34:30 +01:00
Montel Laurent
b040cf0f96 Use Q_FALLTHROUGH 2017-06-02 07:52:48 +02:00
Kevin Funk
740fe5df0e Use nullptr everywhere
Differential Revision: https://phabricator.kde.org/D3987
2017-01-16 09:44:17 +01:00
Allen Winter
09b1ac5a16 imageformats/kra.h - overrides for KraPlugin capabilities() and create() 2016-10-16 11:50:18 -04:00
Heiko Becker
5fdcdff6e3 Drop obsolete version check
Frameworks already require Qt 5.5.0.

REVIEW: 128989
2016-09-23 00:51:41 +02:00
Pino Toscano
172c494cff remove extra ';' 2016-06-09 10:57:48 +02:00
Boudewijn Rempt
6934d54417 Add kra and ora imageio plugins (read-only)
kra is the native format for Krita and ora the interchange format
for krita, gimp and mypaint (it's also mypaint's native format).
Both formats are simply zip containers with an embedded png.

REVIEW:126675
2016-01-31 15:01:32 +01:00
Wolfgang Bauer
5d7ef7c38e fix loading of RLE compressed PSD files
decodeRLEData() expects a quint16 as length, but the PSD loader calls it
 with a quint32.
We do need quint32 for PSD, otherwise it would overflow for images
bigger than 256x256 pixels (it's the pixel count there, i.e. width x
 height).

BUG: 354413
FIXED-IN: 5.19.0
REVIEW: 126684
2016-01-10 13:24:35 +01:00
Kai Uwe Broulik
f2adcb81d1 Recognize image/vnd.adobe.photoshop instead of image/x-psd
REVIEW: 125790
2015-11-07 13:27:42 +01:00
Luca Beltrame
814c7a2b30 Partially revert d7f457a to prevent crash on application exit
The change to QLatin1String to QStringLiteral had a very nasty
unintended side effect, causing many (but not all) applications to
crash on exit.

Laurent, please be wary with blanket changes on low level code as
they might break things in unexpected ways.

CCMAIL: montel@kde.org
CCMAIL: tittiatcoke@gmail.com
2015-11-04 23:51:53 +01:00
Montel Laurent
d7f457a124 Use QStringLiteral 2015-11-02 21:57:43 +01:00
Samuel Gaist
4a54da668a eps: fix includes related to Qt Caterogized Logging
Testing Done:
Build on OS X 10.8

Reviewed at https://git.reviewboard.kde.org/r/125025/
2015-09-03 18:15:54 +02:00
Heiko Becker
e5fce91de6 Remove DDS and JPEG-2000 plugins
They were already disabled when building with Qt >= 5.3 in commit
3d45b270ea because Qt has better plugins
for those image formats. Now that we depend on Qt 5.3 we can remove
them.

REVIEW: 124636
2015-08-06 00:57:14 +02:00
Christoph Cullmann
c7a04b0ed6 less verbose categorized logging, move to ecm module later 2015-08-02 13:01:54 +02:00
Sergio Martins
52c7839741 Initialize variable to silence warning [-Wsometimes-uninitialized]
It's uninitialized if the else {} is hit.
2015-05-02 23:32:24 +01:00
Albert Astals Cid
55af097749 Don't warn the user/developer about something he can't fix
image formats are loaded via qimage/qimagereader and friends, the user/developer does not choose which ones will be used so giving him a warning about sequential devices not being supported is not going to help anyone, only spam their shell/logs.

REVIEW: 123156
Acked by David Edmundson
2015-03-29 23:21:17 +02:00
Dan Vrátil
b7910e169e Fix build with Qt 5.5 (missing QDataStream include) 2015-02-27 19:03:29 +01:00
Alex Merry
873746d04b Build fix for OS/X.
CCMAIL: mk-lists@email.de
2015-02-21 11:41:58 +00:00
Alex Merry
47e8043d45 Make PSD image reader endianess-agnostic.
By using the same strategy as the SoftImage PIC handler (and sharing
some code with it), we should avoid reading the image data incorrectly
on big-endian architectures.

REVIEW: 122650
BUG: 337918
2015-02-20 23:03:10 +00:00
Kevin Funk
ac2b63046f Use Q_DECL_OVERRIDE where possible
REVIEW: 122542
2015-02-13 13:31:27 +01:00
Hrvoje Senjan
4cdcf3a98c Add missing QDataStream include
Fixes build with Qt 5.5
2015-01-17 03:40:59 +01:00
Alex Merry
88518c5862 Update installation variables. 2015-01-10 17:46:30 +00:00
Alex Merry
3d45b270ea Disable the DDS and JPEG-2000 plugins when Qt version is 5.3 or later
QtImageFormats 5.3 comes with DDS and JPEG-2000 plugins that support
more options and are generally better than our plugins. The only
advantage our plugins offer is that the Qt DDS plugin does not work on
sequential devices, while ours does. This is outweighed by other
improvements, though, such as supporting more variants.

REVIEW: 119590
2014-08-04 22:50:37 +01:00
Alex Merry
c9ca1f1862 Rename headers to end with _p.h
Frameworks have a convention of naming uninstalled headers in src/ with
a _p at the end of the name, to make it clear they are not part of the
API. None of the headers in KImageFormats are installed, so it is not
really necessary to follow this convention, but we follow it anyway for
the benefit of both humans and tools (like kapidox).
2014-08-03 18:08:49 +01:00
Alex Merry
2ec0d5abc6 Fix a compiler warning about signed/unsigned comparisons
The "+ 1" was causing an unsigned value to be cast to a signed value,
which was then compared with an unsigned value, causing the warning.
Making the constant unsigned fixes this.
2014-05-30 16:47:19 +01:00
Alex Merry
cca4c545a4 Hide documented internal classes from Doxygen 2014-05-30 16:40:05 +01:00
Alex Merry
87b545f9ed Make sure Doxygen does not interpret license headers as dox
The extra *s were confusing it.
2014-05-30 16:38:45 +01:00
Alex Merry
51eca9b6a8 Rewrite the PIC image format handler
It now uses QDataStream to deal with endianness. It also supports
several QImageIOHandler options.

This comes with a more comprehensive test suite than the old code. Note
that the old test suite was incorrect as the old code wrote the floats
in the header out incorrectly (although no-one noticed because no
software seems to care about those values).

All the test PIC files in the test suite appear correct according to the
specification (by inspection with Okteta). Unfortunately, there is a
lack of other freely-available software that reads and writes PIC files
(the main application that uses them is proprietary), and so this is the
best I can do.

REVIEW: 117944
2014-05-04 13:42:30 +01:00
Alex Merry
889df138bb Update comment for kde4support -> kdelibs4support rename 2014-04-10 18:27:55 +01:00
Alex Merry
6375160828 Remove the WebP format
This will be in Qt 5.3.

REVIEW: 116026
2014-02-25 12:16:34 +00:00
Alex Merry
89a3e64c0e Rename webp.xml to kf5-imagesformats-webp.xml on installation
This prevents a clash with kde-runtime 4, and is a better naming scheme
anyway (to prevent accidental clashes with mime packages from other
software).

REVIEW: 115913
2014-02-24 17:04:04 +00:00
Alex Merry
6272954cc5 Only perform tests for plugins that are built
This both excludes the autotests and tests subdirs if the user sets
BUILD_TESTING off, and makes sure we do not run tests for formats that
were not built due to dependencies not being found.

REVIEW: 115504
2014-02-23 11:54:40 +00:00
Alex Merry
4fbbc75429 WebP: use Q_DECL_OVERRIDE
In doing so, found a method that should not have been overridden, and so
removed it.

REVIEW: 115355
2014-02-20 12:56:17 +00:00
Alex Merry
331a813662 WebP: remove unused include
REVIEW: 115355
2014-02-20 12:56:14 +00:00
Alex Merry
30cff60296 Make WebP mimetype xml match the one in shared-mime-info-git
This includes the detection magic and an alias for image/webp.  It
should be in shared-mime-info 1.3.

Proposed by Jerome Leclanche <adys.wh@gmail.com>.

REVIEW: 115355
2014-02-20 12:56:10 +00:00
Alex Merry
7177296335 Import the WebP image I/O code from kde-runtime
The plugin export mechanism has been patched up (including the addition
of the JSON file), and the FindWebP.cmake file is new.

Writing is currently disabled, as it produces broken images.

Autotests are generated using the cwebp and dwebp utilities distributed
with the libwebp reference library.

REVIEW: 115355
2014-02-20 12:56:00 +00:00
Alex Merry
f490ab0761 Fix mimetype declarations in json files
There has to be one mimetype declaration for each format name.

REVIEW: 115686
2014-02-16 10:46:42 +00:00
Alex Merry
3eafdc861a Remove the xv image format plugin
It appears to be some internal format of xview, although I cannot find
any mention of such a thing on the internet.  There does not appear to
be any sort of mime type to associate with this file format, either.

Therefore, I think it is reasonable to declare it obsolete.

REVIEW: 115768
2014-02-15 18:47:06 +00:00
Alex Richardson
63705e373e Use #pragma pack instead of __attribute__((packed))
This is available on all supported compilers, the attribute does not exist
for MSVC

REVIEW: 115345
2014-02-03 18:24:01 +01:00
Alex Richardson
a533bcd418 Use q{To,From}BigEndian instead of hton* and ntoh*
These functions don't seem to be available as inline functions on win32

REVIEW: 115345
2014-02-03 18:23:37 +01:00
Alex Merry
d5c589dae3 Use new kde_target_enable_exceptions() function from ECM 2014-01-27 12:42:26 +00:00
Alex Merry
b2083df231 Add an imported target to FindOpenEXR.cmake
This simplifies using the find module.

REVIEW: 115123
2014-01-27 12:26:26 +00:00
Alex Merry
0ee3ffb368 Clean up the CMake files (and a couple of other bits)
src/imageformats/CMakeLists.txt is now much clearer and more consistent.

Also, removed an unnecessary/unimplemented method from exr.cpp.

REVIEW: 115120
2014-01-27 11:43:17 +00:00
Alex Merry
7be60a7bd0 Fill out README.md file
Also delete the old README file, as README.md now contains the
information from it.
2013-12-22 16:12:02 +00:00
David Faure
02b5e97197 Code reformatted using kde-dev-scripts/astyle-kdelibs.
Use git blame -w 47df948 to show authorship as it was before this commit.
2013-12-18 09:54:11 +01:00
Jenkins CI
47df9483fd Move kimageformats code to the root directory. 2013-12-18 00:45:18 +00:00