Last Comment Bug 510670 - gzip-encoded image is not decoded ("corrupt") when dragged from Camino/Firefox
: gzip-encoded image is not decoded ("corrupt") when dragged from Camino/Firefox
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Drag and Drop (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla11
Assigned To: :Gavin Sharp [email: gavin@gavinsharp.com]
:
Mentors:
: 363408 397002 495196 707600 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-15 05:38 PDT by nochance2
Modified: 2011-12-16 06:09 PST (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.34 KB, patch)
2011-12-15 11:07 PST, :Gavin Sharp [email: gavin@gavinsharp.com]
bzbarsky: review+
Details | Diff | Splinter Review

Description nochance2 2009-08-15 05:38:32 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.11) Gecko/2009060219 Camino/2.0b3 (like Firefox/3.0.11)
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.11) Gecko/2009060219 Camino/2.0b3 (like Firefox/3.0.11)

Images contained in webpages when dragged to the Desktop are sometimes corrupt.

Reproducible: Always

Steps to Reproduce:
1.Go to http://www.rapidshare.com/
2. Drag the big rapidshare logo image to your desktop
3. Open it
Actual Results:  
Couldn’t open the file. It may be corrupt or a file format that Preview doesn’t recognize.

Expected Results:  
The file should open in Preview like it happens when Safari is used.

This is  not a problem with all images but I have encountered this problem many times on different websites.
Comment 1 philippe (part-time) 2009-08-15 06:21:15 PDT
It is not only Camino. Firefox (3.0.x and newer) is equally affected.
There is dupe somewhere, I think.

On Rapidshare at least, the image is gzipped. Somehow drag&drop doesn't unzip the image.
Right click, 'save as' works correctly though.
Comment 2 Smokey Ardisson (offline for a while; not following bugs - do not email) 2009-08-15 11:25:45 PDT
I don't see any gzip headers sent with that image when I 'curl -I' it, which could be the problem.

As far as the dupe, there's bug 495196, but it's unusable as a bug for fixing anything ;)  According to that bug, though, the problem is Mac-only, so kicking to Widget:Cocoa for further triage (but the example in that bug WFM, but it also sends no gzip headers).
Comment 3 Jo Hermans 2009-08-15 12:43:33 PDT
bug 363408 ?
Comment 4 philippe (part-time) 2009-08-15 17:33:49 PDT
Fwiw - right click on the image and copy, then paste in Preview.app works fine.


(In reply to comment #2)
> I don't see any gzip headers sent with that image when I 'curl -I' it, which
> could be the problem.

I see it with the LiveHTTPHeaders extension on Minefield
HTTP/1.x 200 OK
P3P: CP="ALL DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONa TELa OUR STP UNI NAV STA PRE"
Date: Sun, 16 Aug 2009 00:28:59 GMT
Connection: close
Accept-Ranges: bytes
Content-Type: image/gif
Expires: Sun, 16 Aug 2009 00:58:59 GMT
Set-Cookie: user=; domain=.rapidshare.com; path=/; expires=Mon, 21-Nov-1994 16:01:23 GMT
Content-Encoding: gzip
Content-Length: 3857
Comment 5 Smokey Ardisson (offline for a while; not following bugs - do not email) 2009-08-16 15:35:32 PDT
(In reply to comment #4)
> > I don't see any gzip headers sent with that image when I 'curl -I' it, which
> > could be the problem.
> 
> I see it with the LiveHTTPHeaders extension on Minefield

Could certainly be that the server adds it depending on UA or other accept-* headers.

(In reply to comment #3)
> bug 363408 ?

Sounds like Jo wins the prize (and dolske the goat for filing in Firefox, but to be fair I suspect he wasn't working on Firefox back then) ;)

I think we have marginally more info here (namely that's it really only drag-drop; copy/paste works, so it's got to be in the code that's not shared between the two), so going to confirm this one and dupe dolske forward.
Comment 6 Smokey Ardisson (offline for a while; not following bugs - do not email) 2009-08-16 15:36:14 PDT
*** Bug 363408 has been marked as a duplicate of this bug. ***
Comment 7 philippe (part-time) 2009-08-16 17:37:55 PDT
bug 397002 was the one I was thinking about; I'll forward dupe it here, as we have more details.
Comment 8 philippe (part-time) 2009-08-16 17:38:43 PDT
*** Bug 397002 has been marked as a duplicate of this bug. ***
Comment 9 Henrik Skupin (:whimboo) 2009-11-26 08:50:12 PST
*** Bug 495196 has been marked as a duplicate of this bug. ***
Comment 10 Henrik Skupin (:whimboo) 2009-11-26 08:51:24 PST
Does that also happen with Firefox 2.0.0.20?
Comment 11 Smokey Ardisson (offline for a while; not following bugs - do not email) 2009-11-29 22:58:00 PST
(In reply to comment #10)
> Does that also happen with Firefox 2.0.0.20?

I do see the bug with the rapidshare logo using Camino 1.6.10 (Gecko 2.0.0.23), and dolske's dupe was set to "2.0 branch" in the Firefox product.  I assume it's a bug in the Mac drag code from time immemorial.
Comment 12 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-12-15 09:04:26 PST
*** Bug 707600 has been marked as a duplicate of this bug. ***
Comment 13 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-12-15 11:01:07 PST
This is actually a bug in core code, but the code seems to only be used by Mac at the moment (at least for image dropping).
Comment 14 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-12-15 11:07:03 PST
Created attachment 582035 [details] [diff] [review]
patch

This fixes the bug, by having the webbrowserpersist that's used for dropped files on some platforms automatically handle conversion as needed.
Comment 15 Boris Zbarsky [:bz] 2011-12-15 11:11:06 PST
Comment on attachment 582035 [details] [diff] [review]
patch

Good catch.  r=me
Comment 16 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-12-15 11:21:10 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee190c4d5bfe
Comment 17 Ed Morley [:emorley] 2011-12-16 06:09:52 PST
https://hg.mozilla.org/mozilla-central/rev/ee190c4d5bfe

Note You need to log in before you can comment on or make changes to this bug.