Its library
Previous.
Next.

Its library

Almost all image viewers use third-party libraries for decoding. Examples include libraries such as imlib (Image Magic) or Qt. At first glance, the advantages of this method are obvious - it shifts the decoding of images to other libraries, even abstracting from low-level imaging, alpha channels, bit masks, RLE encoding, and more. But this method has some obvious drawbacks. Firstly, the partial absence of an extensible set of image codecs. Secondly, it is dependent on the codecs large (sometimes very large) libraries, such as Qt. Thirdly, the lack of support for animations, such as GIF, FLI or MNG. Fourthly, lack of decoding of individual rows.

Because of these drawbacks, it was decided not to use third-party libraries, and develop libraries specifically for KSquirrel that would not depend on other libraries, in addition to standard libraries which are required by the codecs (such as libsvg, libmng et al.), and loaded dynamically, be fully extensible to support decoding of rows and animation. These libraries are called « ksquirrel-libs ».

At the time of writing this documentation ksquirrel-libs supported 51 image formats, including PNG , JPEG , Photoshop PSD , AutoCAD DXF , WMF , SVG , MNG and GIF . There are also codecs to support font files TTF , animations FLI and X-cursor cursors.

ksquirrel-libs also supports text fields (comments, etc.), stored in certain types of images. For example, PNG and GIF codecs can read comments from data file types.

Working with KSquirrel libraries

Due to the above properties of the ksquirrel-libs libraries, KSquirrel has the following features:

  1. KSquirrel does not know which codec is used for decoding the image - that is determined dynamically.

  2. KSquirrel does not know how many pages are in the decoded image and whether it has animation - that is determined dynamically.

  3. With support for decoding of separate lines, ksquirrel shows images progressively.

When KSquirrel has uploaded all the libraries found (using Qt QLibrary class), it is possible to display any supported types of images (both static and animated). When the user selects an image in the Navigator, ksquirrel, by MIME type or file extension, determines whether the image format is supported. If this format is supported, ksquirrel proceeds to decode the image and display it in the preview window.

Information on all codecs can be found in the dialogue screen « Action|Codec information... », as shown in the screenshot.


Information on the found codecs

Tip: a settings icon may be displayed to the left of the codec, as shown in the figure for the codec GIMP XCF. This means that the codec can be configured with different parameters. For example, for GIMP XCF codec, the background color for transparent images can be configured.

Previous.
Next.
Contents
KSquirrel differs from other viewers Interface


Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team