Last Comment Bug 163458 - Corrupted image when saved w/o filename extension
: Corrupted image when saved w/o filename extension
Status: RESOLVED WORKSFORME
:
Product: Core Graveyard
Classification: Graveyard
Component: File Handling (show other bugs)
: Trunk
: PowerPC Mac OS X
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
: 196899 383005 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-19 05:31 PDT by Benjamin Mucci
Modified: 2016-06-22 12:16 PDT (History)
8 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Benjamin Mucci 2002-08-19 05:31:29 PDT
Save any image (gif or jpeg) and remove the extension

Ex: myimage.gif -> myimage

Then save the file. 

Result: image is corrupted.

Mozilla 1.1b
Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.1b) Gecko/20020816
Comment 1 Tuukka Tolvanen (sp3000) 2002-08-19 07:11:40 PDT
worksforme linux trunk cvs 2002-08-19, tried with a jpeg image. Reporter, can
you add a link to an image with which this bug occurs? How do you determine that
the image is corrupted?
Comment 2 Benjamin Mucci 2002-08-19 08:06:18 PDT
hmmm I filed this bug on the behalf of someone else... I tried with photoshop
and it's fully reproducible but I can't reproduce with other apps like graphic
converter and PictureViewer as he can. Anyway here the recipe for photoshop:

Go to http://www.mozilla.org/ 
Save the header image via the contextual menu "save image as"
In the save dialog change mozilla-banner.gif for mozilla-banner
Try to open the saved file in Photoshop.

This have something to do with the type / creator under MacOS I think, because
the default type/creator is set to Moz when the file is saved w/o extension
[TEXT/MOZZ]. If I add the extension or change the type for GIFf, Photoshop opens
the file as expected. 

Cc greg.

Greg, I think the file even w/o the right extension should get the right file
type under MacOS. Perhaps related to Bug 156191...
Comment 3 Greg K. 2002-08-19 10:51:31 PDT
Confirmed using Mac/2002080208/9.2.2. Mozilla needs to be setting the Type code based on 
a reliable metadata chain. First, MIME type, if available. Second, original filename extension. 
Third, destination filename extension.

Mozilla seems to be completely ignoring the original MIME type of the image and setting the Type 
code based *exclusively* on the *destination* filename extension, and I can't imagine a more 
flawed logic for this operation.
Comment 4 Stefan [:stefanh] 2003-04-02 16:44:40 PST
*** Bug 196899 has been marked as a duplicate of this bug. ***
Comment 5 Stefan [:stefanh] 2003-04-02 16:47:21 PST
Changing OS & adding qawanted (from the dupe)
Comment 6 Adam Guthrie 2007-06-02 23:13:23 PDT
*** Bug 383005 has been marked as a duplicate of this bug. ***
Comment 7 Matthew Middleton (:zzxc) 2011-10-12 14:17:09 PDT
A user on SUMO reported another way to reproduce this in current (Firefox 7) builds on OS 10.6:
1. Click on a file download link, such as https://zzxc.net/sumo/attach/test.jpg
2. In the File Save dialog, try to overwrite an existing file with the same type by clicking it in this dialog.
3. The file saves without a file extension, without overwriting the target file.
Comment 8 Bogdan Maris, QA [:bogdan_maris] 2013-08-21 06:14:50 PDT
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:26.0) Gecko/20100101 Firefox/26.0

Works for me on latest Nightly (buildID: 20130821030213) and Firefox 24 beta 4 (buildID: 20130819170952).

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