Bug 474846

Summary: Bogus format inference warnings with `.ico` files: Image format is actually "ico" not "ico"
Product: [Applications] gwenview Reporter: SC <kde>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: idontfeelcomfygivingyoumyemail
Priority: NOR    
Version First Reported In: 23.08.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: A few example icons

Description SC 2023-09-25 06:39:43 UTC
Created attachment 161852 [details]
A few example icons

SUMMARY
When opening an `.ico` file, gwenview emits bogus format inference warnings on stderr:
```
$ gwenview foo.ico
kf.i18n.kuit: "Unknown subcue ':whatsthis,' in UI marker in context {@info:whatsthis, %1 the action's text}."
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-samsung-srw"
org.kde.kdegraphics.gwenview.lib: QImageReader::read() using format hint "ico" failed: "Unknown error"
org.kde.kdegraphics.gwenview.lib: A bad Qt image decoder moved the buffer to 22 in a call to canRead()! Rewinding.
org.kde.kdegraphics.gwenview.lib: Image format is actually "ico" not "ico"
org.kde.kdegraphics.gwenview.lib: Gwenview cannot apply color profile on QImage::Format_ARGB32_Premultiplied images
```
The image viewer still opens and displays the image correctly, which is why I reported this as a minor issue. But this shows that the inference implementation is likely buggy.

STEPS TO REPRODUCE
1. Obtain a valid `.ico` image
2. In a terminal, run `gwenview <image.ico>`
3. Observe the output of stderr

OBSERVED RESULT
Bogus warnings.

EXPECTED RESULT
Format inference succeeds without warnings.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.4-arch2-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
See attached for a few `.ico` files. But I think any valid `.ico` file will do.