Bug 210962 - konqueror displays garbage when viewing JPEGs using KHTML
Summary: konqueror displays garbage when viewing JPEGs using KHTML
Status: RESOLVED DUPLICATE of bug 205088
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-18 13:53 UTC by Roman Fietze
Modified: 2009-11-15 14:47 UTC (History)
1 user (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 Roman Fietze 2009-10-18 13:53:35 UTC
Version:            (using KDE 4.3.2)
OS:                Linux
Installed from:    SuSE RPMs

When viewing JPEG photografs usiing konqueror, they are displayed as ASCII text instead of using any embedded image viewer (ÿØÿà JFIF  H H ÿá#4Exif II*    z  ...).

This only happens when I use KHTML. When I switch to webkit or use any other browser, the image is displayed correctly.
Comment 1 Maksim Orlovich 2009-10-18 18:18:00 UTC
How in the world do you do that? KHTML isn't associated with image/* mimetypes, so it shouldn't be even a choice. Instead, the "embeddable image viewer" (KHTMLImage) is, and handles things just fine.
Comment 2 Roman Fietze 2009-10-18 21:23:55 UTC
(In reply to comment #1)

> How in the world do you do that?

Hmmm. I didn't know I'm able to things I shouldn't be able to. ;)

I just open the imahe using konqueror. I get the garbage (the ASCII text). The I select View -> View Mode -> WebKit, et voilà, I get the image properly displayed. If I switch back using ... -> KHTML the ASCII text comes back.

I'm using the newest 4.3.2 packages from the openSUSE KDE4:/43 repos.

> KHTML isn't associated with image/* mimetypes,
> so it shouldn't be even a choice. Instead, the "embeddable image viewer"
> (KHTMLImage) is, and handles things just fine.

Before I logged in into KDE4 the first time, I removed ~/.kde4, because I knew that old setting from 4.1.3 or even 4.2.4 could make things worse. So my konqueror settings and the file associations have been the defaults. They were set to use the internal viewer.

Why I do get that result? I just don't know.
Comment 3 Tommi Tervo 2009-10-18 21:55:28 UTC
I can reproduce this one. If jpeg's are on server which requires password (WWW-Authenticate: Basic realm), khtml displays those images as a plaintxt.

Here is dump from the webserver headers (wget -S), I'll make a public test case soon..

HTTP request sent, awaiting response...                                                        
  HTTP/1.1 401 Authorization Required                                                          
  Date: Sun, 18 Oct 2009 19:49:55 GMT                                                          
  Server: Apache/2.2.3 (Red Hat)                                                               
  WWW-Authenticate: Basic realm="Members Only"                                                 
  Content-Length: 483
  Connection: close
  Content-Type: text/html; charset=iso-8859-1
Connecting to panokone.kyla.fi|82.130.59.60|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Sun, 18 Oct 2009 19:49:55 GMT
  Server: Apache/2.2.3 (Red Hat)
  Last-Modified: Sat, 17 Oct 2009 21:02:12 GMT
  ETag: "248a21-242e-d38edd00"
  Accept-Ranges: bytes
  Content-Length: 9262
  Connection: close
  Content-Type: image/jpeg
Length: 9262 (9.0K) [image/jpeg]
Saving to: `000212.jpg'
Comment 4 Tommi Tervo 2009-10-18 22:04:21 UTC
Test case:
http://panokone.kyla.fi/temp/
username/pw: kde / konq

Then just open top-kde.jpg
Comment 5 Maksim Orlovich 2009-10-18 22:14:07 UTC
@ teve: I think what you stated is a dupe --- I recall other reports about kio_http returning the wrong mimetype on 401.  

@ Reporter: does it always happen, or only in some cases?

cat /opt/kde42/share/kde4/services/khtml.desktop|grep MimeType
MimeType=text/html;application/xml;application/xhtml+xml;
Comment 6 Roman Fietze 2009-10-19 07:10:47 UTC
(In reply to comment #5)

> @ Reporter: does it always happen, or only in some cases?

I could repeat that misbehaviour in all of my tests, I tested it about 20 times. Even konqueror 3.5.10 shows that bug on my box.

I can repeat that on another box at work, using either 3.5.10 or 4.3.2.

And yes, it only happens when I have to authenticate.

> cat /opt/kde42/share/kde4/services/khtml.desktop|grep MimeType
> MimeType=text/html;application/xml;application/xhtml+xml;

On the openSUSE 11.1, KDE 4.3.2 box:

$ cat /usr/share/kde4/services/khtml.desktop | fgrep MimeType
MimeType=text/html;application/xml;application/xhtml+xml;
Comment 7 Tommi Tervo 2009-11-15 14:47:26 UTC

*** This bug has been marked as a duplicate of bug 205088 ***