QImageReader documentation update [ci skip]

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-09-16 13:46:21 +03:00
parent 1974bc0dea
commit 59f0d21c61

View file

@ -427,28 +427,22 @@ QByteArray QImageReader::format() const
it is disabled. By default, autodetection is enabled. it is disabled. By default, autodetection is enabled.
QImageReader uses an extensive approach to detecting the image format; QImageReader uses an extensive approach to detecting the image format;
firstly, if you pass a file name to QImageReader, it will attempt to firstly, if you pass a file name to QImageReader. It uses the following
detect the file extension if the given file name does not point to an approach to detect the image format:
existing file, by appending supported default extensions to the given file
name, one at a time. It then uses the following approach to detect the
image format:
\list \list
\o Image plugins are queried first, based on either the optional format \o Built-in handlers are checked based on format string.
string, or the file name suffix (if the source device is a file). No
content detection is done at this stage. QImageReader will choose the
first plugin that supports reading for this format.
\o If no plugin supports the image format, Qt's built-in handlers are \o If no built-in image handler recognizes the format and auto detection
checked based on either the optional format string, or the file name is enabled the image contents is inspected.
suffix.
\o If no capable plugins or built-in handlers are found, each plugin is \o Image plugins are queried based on the format string. No content
tested by inspecting the content of the data stream. detection is done at this stage. QImageReader will choose the first
plugin that supports reading for this format.
\o If no plugins could detect the image format based on data contents, \o If no capable plugins handlers are found, each plugin is tested by
each built-in image handler is tested by inspecting the contents. inspecting the content.
\o Finally, if all above approaches fail, QImageReader will report failure \o Finally, if all above approaches fail, QImageReader will report failure
when trying to read the image. when trying to read the image.
@ -456,8 +450,7 @@ QByteArray QImageReader::format() const
\endlist \endlist
By disabling image format autodetection, QImageReader will only query the By disabling image format autodetection, QImageReader will only query the
plugins and built-in handlers based on the format string (i.e., no file plugins and built-in handlers based on the format string.
name extensions are tested).
\sa QImageIOHandler::canRead(), QImageIOPlugin::capabilities() \sa QImageIOHandler::canRead(), QImageIOPlugin::capabilities()
*/ */