Open Bug 313559 Opened 19 years ago Updated 2 years ago

Cache can't have multiple instances of the same URL (screws up SAVE IMAGE AS)

Categories

(Firefox :: General, defect)

3.6 Branch
x86
Windows XP
defect

Tracking

()

People

(Reporter: revengist, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1

Some sites use image randomizers. Perhaps Joe Shmoe loads the same site which uses a randomized image, in 5 different tabs. He goes back to the 1st tab and rightclicks on the randomized image and saves it. When he views the image he saved, he will see the image from the 5th tab instead of the 1st tab.

Reproducible: Always

Steps to Reproduce:
1. Find an image that changes often
2. Load it up a couple times in different windows/tabs
3. Save the image from one of the windows/tabs.
4. Instead of it saving the image you saw on screen, it saves the cached image.

Actual Results:  
Saved the wrong image.

Expected Results:  
Should have saved the image painted on screen.

for testcase, view attachment html file
Summary: Save Image As... doesn't save the image painted on screen → Save Image As... doesn't save the image painted on screen; pulls the wrong image from the cache
Related to Core bug 120809 comment 56?
(In reply to comment #2)
> Related to Core bug 120809 comment 56?
> 

Somewhat. The real problem is that the cache uses urls as keys. That means if you load an image from the SAME url multiple times, it will just keep overwriting the SAME cache entry since the KEY is always the same. Hope this clarifies the problem.
(In reply to comment #3)
> (In reply to comment #2)
> > Related to Core bug 120809 comment 56?
> > 
> 
> Somewhat. The real problem is that the cache uses urls as keys. That means if
> you load an image from the SAME url multiple times, it will just keep
> overwriting the SAME cache entry since the KEY is always the same. Hope this
> clarifies the problem.
> 

I think I may have screwed that up a bit. The cache needs to allow for multiple entries of the same url through some kind of workaround. When a document is unloaded - the cache entries / if there are duplicaes / and that page's one is now the newest, to destroy it.

Summary: Save Image As... doesn't save the image painted on screen; pulls the wrong image from the cache → Cache can't have multiple instances of the same URL (screws up SAVE IMAGE AS)
This bug was reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.3 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 5-15-2010]
Version: unspecified → 1.5.0.x Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.x or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
This bug is still not fixed.
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Example: Open up 3 tabs with http://demo.marcofolio.net/php_random_image_rotation/rotate.php as the url. Try to save the image on the first tab. You will get a non-matching image when you view it on your Hard-Disk
So, you still see this with Firefox 3.6.3 in a fresh profile?
Yes sir.
Whiteboard: [CLOSEME 5-15-2010]
Version: 1.5.0.x Branch → 3.6 Branch
I think this annoyance has been present for over 10 years.  "Save Image As..." behaved like this in Netscape 6 (Gecko/20010131), and I can confirm it still does in latest builds (4.0b10pre (2011-01-23)).  It's a similar sort of thing to bug 136633, which affects "View Source".  It's also annoying when a browser, told to save the page you're looking at, fetches it again, which has been the subject of other bugs that may or may not have been resolved.

I've also tested http://demo.marcofolio.net/php_random_image_rotation/rotate.php on some other contemporary browsers.  To recap, this is a URL that provides different image/jpeg content each time it's retrieved over HTTP/1.1, without Expiry or other cache-related headers.  

In short, only Safari (on Win XP) behaves as a user would usually intend.  That is, each occurrence on each tab may be different, but "Save As" saves a copy of the image that the user is actually looking at.

IE8, Avant and Maxthon 2 (on Win XP) all behave like Mozilla.  That is, if a more recent page resource been opened with the same URL, the image saved is the most recently cached copy, not necessarily what the user intends.  (Maxthon also fetches new instances of the URL from cache unless you reload.)

Chrome and Galeon are worse, in that they fetch a whole new copy of the image to save, possibly one the user has never seen before, rather than resorting to cache.

Konqueror and Opera 11 always render the cached image on the page.  That is, if you open another tab with a fresh instance of the URL and switch back, the previous image has changed to match it.  This means that at least when you save an image it is the same as the one you see, although you may have lost the content you really wanted.

In order to get "Save Image As" to work in an intuitive fashion, I suggest it should identify the HTMLImageElement from the DOM of the page, and save the copy that is in memory.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: