Bug 362999 - KRA and ORA plugins are not recognised by QImageReader
Summary: KRA and ORA plugins are not recognised by QImageReader
Status: CONFIRMED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
: 423637 438807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-13 02:11 UTC by Andrius
Modified: 2021-08-16 09:37 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrius 2016-05-13 02:11:42 UTC
after installing KImageformats, QImageReader::supportedMimeTypes() shows mimetypes except for KRA and ORA formats. QImageReader::read() doesn't seem to try using their respective handlers either.

Reproducible: Always
Comment 1 Halla Rempt 2021-02-13 13:52:18 UTC
*** Bug 423637 has been marked as a duplicate of this bug. ***
Comment 2 Bug Janitor Service 2021-02-13 14:50:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/17
Comment 3 Albert Astals Cid 2021-03-04 22:05:50 UTC
I don't see how merge request 17 is going to fix this. That MR is about fixing loading of files themselves, this bug is about QImageReader doesn't even knowing it can open those kind of files.

Andrius maybe you didn't get those plugins compiled?
Comment 4 Nate Graham 2021-04-06 14:47:40 UTC
*** Bug 435402 has been marked as a duplicate of this bug. ***
Comment 5 Halla Rempt 2021-04-06 15:38:25 UTC
It fixes the canRead method, not the reading of the files itself.
Comment 6 Nate Graham 2021-04-06 15:58:37 UTC
Thanks for mentioning that.
Comment 7 Halla Rempt 2021-04-06 17:52:44 UTC
I need to improve on it, though, I'll try to do that tomorrow, since that "magic" string can be in a wider range of locations.
Comment 8 Deri James 2021-04-06 20:12:56 UTC
It may be that the reason the position changes is because quazip is using deflate on the mimetype file rather than just storing it uncompressed. This does not make much sense because the compressed size (24 bytes) is longer than the uncompressed size (19 bytes), using zip64 the difference is greater. Is there a way to tell quazip to store the file "mimetype" (rather than deflate) or to not deflate files which grow larger when compressed.
Comment 9 Halla Rempt 2021-04-07 08:02:13 UTC
I would be surprised if it was that, since the mimetype is readable in the binary, so it's not compressed.
Comment 10 Halla Rempt 2021-04-07 09:57:40 UTC
I think I've got it, at least for the position of the string. The kzip store called         

m_pZip->setExtraField(KZip::NoExtraField);

And for quazip that's apparently

dd->archive->setDataDescriptorWritingEnabled(false);

I'll still have rework this patch, though, since that's needed for 64 bits zipped kra files
Comment 11 Deri James 2021-04-07 11:27:26 UTC
If you do a "zipinfo -v" on the .kra file produced by quazip you get:-

=========================================================================

Archive:  ../Wales.kra
There is no zipfile comment.

End-of-central-directory record:
-------------------------------

  Zip archive file size:                  38332741 (000000000248E945h)
  Actual end-cent-dir record offset:      38332719 (000000000248E92Fh)
  Expected end-cent-dir record offset:    38332719 (000000000248E92Fh)
  (based on the length of the central directory and its expected offset)

  This zipfile constitutes the sole disk of a single-part archive; its
  central directory contains 43 entries.
  The central directory is 3049 (0000000000000BE9h) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 38329670 (000000000248DD46h).


Central directory entry #1:
---------------------------

  mimetype

  offset of local header from start of archive:   0
                                                  (0000000000000000h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   3.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          yes
  file last modified on (DOS date/time):          2020 Jul 8 16:13:24
  32-bit CRC value (hex):                         a703f0a1
  compressed size:                                24 bytes
  uncompressed size:                              19 bytes
  length of filename:                             8 characters
  length of extra field:                          0 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             binary
  Unix file attributes (100444 octal):            -r--r--r--
  MS-DOS file attributes (00 hex):                none

  There is no file comment.

Central directory entry #2:
---------------------------

  There are an extra 16 bytes preceding this file.

  maindoc.xml

  offset of local header from start of archive:   78
                                                  (000000000000004Eh) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   3.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          yes
  file last modified on (DOS date/time):          2020 Jul 8 16:13:24
  32-bit CRC value (hex):                         afbe52a3
  compressed size:                                1266 bytes
  uncompressed size:                              5070 bytes
  length of filename:                             11 characters
  length of extra field:                          0 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             text
  Unix file attributes (100444 octal):            -r--r--r--
  MS-DOS file attributes (00 hex):                none

  There is no file comment.

Central directory entry #3:
---------------------------

  There are an extra 16 bytes preceding this file.

=========================================================================

You can see that the first file (mimetype) is shown as deflated and the 
compressed size is larger than the original. It also shows there is no 
extra field, although there appears to be a 16 byte gap between each file.

This is the equivalent zipinfo for a .kra file which was produced by kzip.

=========================================================================
Archive:  ../WalledGarden.kra
There is no zipfile comment.

  Zip archive file size:                  27595676 (0000000001A5139Ch)
  Actual end-cent-dir record offset:      27595654 (0000000001A51386h)
  Expected end-cent-dir record offset:    27595654 (0000000001A51386h)
  (based on the length of the central directory and its expected offset)

  This zipfile constitutes the sole disk of a single-part archive; its
  central directory contains 54 entries.
  The central directory is 4228 (0000000000001084h) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 27591426 (0000000001A50302h).


Central directory entry #1:
---------------------------

  mimetype

  offset of local header from start of archive:   0
                                                  (0000000000000000h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   2.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             none (stored)
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2020 Jul 4 00:06:16
  32-bit CRC value (hex):                         a703f0a1
  compressed size:                                19 bytes
  uncompressed size:                              19 bytes
  length of filename:                             8 characters
  length of extra field:                          0 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             binary
  Unix file attributes (100644 octal):            -rw-r--r--
  MS-DOS file attributes (00 hex):                none

  There is no file comment.

Central directory entry #2:
---------------------------

  maindoc.xml

  offset of local header from start of archive:   57
                                                  (0000000000000039h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   2.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2020 Jul 4 00:06:16
  32-bit CRC value (hex):                         bfca0969
  compressed size:                                1417 bytes
  uncompressed size:                              5876 bytes
  length of filename:                             11 characters
  length of extra field:                          0 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             binary
  Unix file attributes (100644 octal):            -rw-r--r--
  MS-DOS file attributes (00 hex):                none

  There is no file comment.

Central directory entry #3:
---------------------------

  documentinfo.xml

=========================================================================
Comment 12 Maik Qualmann 2021-06-17 15:51:37 UTC
*** Bug 438807 has been marked as a duplicate of this bug. ***