Closed Bug 176258 Opened 22 years ago Closed 15 years ago

attached ps or eps files lost the newline character at the end of the files.

Categories

(MailNews Core :: Attachments, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 291899

People

(Reporter: liguo.song, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020826
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020826

If a ps or eps file is attached to an e-mail and saved by the receiver, the
saved ps or eps file will be 1 byte smaller than the original one, with the
newline character at the end removed.

For example, Test.eps is 575395 bytes originally. It will become 575394 bytes
after attached and saved by the receiver. The newline character at the end of
the file is missing.

This doesn't happen to ASCII or Linux binary executables.

Reproducible: Always

Steps to Reproduce:
1. Get a ps or eps file, take down the size of this file in bytes, call it N0.
2. Attache the above file to email sent to yourself.
3. Upon receiving the greeting from yourself, save the attachment.
4. Compare the file size, N1, of the saved attachment with the original one. Or,
do a diff.

Actual Results:  
N0 - N1 = 1, which should be 0.
The result of diff will state that the save attachment doesn't have a newline at
the end of the file while the original one have.

Expected Results:  
N0 - N1 = 0
diff should return nothing.
QA Contact: trix → yulian
QA Contact: yulian → stephend
I'm not sure if this is the exact same thing that's happening, but I have 
observed the following under Windows:
With a PS file that's encoded for Linux (0A as the newline character), the 
attachment is saved with 0D-0A newlines, changing the size.  However, the 0A at 
the end of the file is also converted to 0D-0A, and maybe this difference isn't 
important (I haven't worked with PS/EPS files).
Product: MailNews → Core
Confirmed: 

Using Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050302

Steps to Reproduce

1. Open web page (such as bugzilla.mozilla.org)
2. File, Print, select print to file
3. Save as /tmp/test.ps
4. Copy /tmp/test.ps /tmp/1.ps
5. Send yourself an email, attatching 1.ps as attachment
6 [details]. When you receive the email, save attachment as 2.ps
7. diff /tmp/1.ps /tmp/2.ps

Expected Result: No difference

Actual Results: Different file (see below)

sannear@sunray1:/tmp> diff 1.ps 2.ps
11621c11621
< %%EOF
---
> %%EOF
\ No newline at end of file

Status: UNCONFIRMED → NEW
Ever confirmed: true
See Bug 291899 for enhancement request of changing application/postscript
handling to Binary Mode(Base64).
The issue described in comment 1 is addressed in bug 269390 which has a patch.
Dup of bug 142517 ? This is possibly fixed by patch from bug 269390 comment 7
(attachment 200327 [details] [diff] [review]).
Assignee: mscott → nobody
QA Contact: stephend → attachments
Product: Core → MailNews Core
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.