Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1920 closed defect (fixed)

attached binary files get displayed as HTML preview

Reported by: vittorio Owned by: Jonas Borgström
Priority: high Milestone: 0.9
Component: general Version: devel
Severity: major Keywords: regression attachment
Cc: vittorio@…, vyt@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

some binary files attached to tickets or wiki pages get displayed as HTML preview. others dont. i couldnt find out why some files get displayed as HTML preview, so i will attach some.

using trunk r2068

Attachments (2)

XPLA3_errata.pdf (136.4 KB ) - added by vittorio 19 years ago.
pdf gets displayed as HTML preview
att_test_FAIL (1 byte ) - added by vittorio 19 years ago.
file only contains 0x1A

Download all attachments as: .zip

Change History (15)

by vittorio, 19 years ago

Attachment: XPLA3_errata.pdf added

pdf gets displayed as HTML preview

by vittorio, 19 years ago

Attachment: att_test_FAIL added

file only contains 0x1A

comment:1 by vittorio, 19 years ago

it looks like all attachments (<256kB) are displayed as HTML preview now in trunk r2068. some with an empty preview box though. this wasnt the case with trunk r1739 when i have seen the problem for the first time. there some got displayed as preview, some correctly offered a "download this file" link only.

comment:2 by Christopher Lenz, 19 years ago

Milestone: 0.9

comment:3 by vittorio@…, 19 years ago

Cc: vittorio@… added
Keywords: attachment added

comment:4 by vittorio@…, 19 years ago

Keywords: regression added

does work correct in 0.8.4

comment:5 by Christian Boos, 19 years ago

Resolution: fixed
Status: newclosed

Should also by fixed by r2108.

comment:6 by Matthew Good, 19 years ago

Resolution: fixed
Status: closedreopened

I don't think that we should be using special exceptions for certain mimetypes to treat as binary. The mimetypes are classified as "text/" or "application/" to help make this distinction. I think that we should only provide textual previews for mimetypes that begin with "text/".

comment:7 by Matthew Good, 19 years ago

Resolution: fixed
Status: reopenedclosed

[2113] will only use the PlainTextRenderer for mimetypes that are textual.

comment:8 by Christopher Lenz, 19 years ago

The problem with [2113] is that now files with types such as "application/xhtml+xml" or "application/xml" will not be displayed by Trac unless SilverCity or Enscript is installed. Not sure if that's acceptable.

comment:9 by Christian Boos, 19 years ago

Resolution: fixed
Status: closedreopened

Yes, I was about to write something similar

Well, what about:

  • image/x-xpixmap (XPM files)
  • the various application/*+xml (* = xhtml, rdf, svg, etc.)
  • the various application/x-*) (* = some programming language, like csh, sh, etc.)

That's why we had the is_binary heuristic. Please consider reverting r2113.

comment:10 by Christian Boos, 19 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in [2179], doing the check in get_quality_ratio as suggested.

comment:11 by anonymous, 19 years ago

Resolution: fixed
Status: closedreopened

I don't think this is a solution. There are many files that are not binary but also not useful in plaintext. And there are many files that are useful in plaintext but are not in the text/ group.

I think it would be better to offer the user both options view and download right in the attachments list. The default should be what the mime-type dictates. For binary files (heuristic) the view-option could be hidden or deactivated. For files in the image/ group the view-option should be activated and mean "view as image".

comment:12 by Matthew Good, 19 years ago

Resolution: fixed
Status: reopenedclosed

Images are already handled by another mime viewer and will be displayed appropriately. The ticket is just regarding types that Trac tries to display as plaintext that it shouldn't. If there are other file types that are inappropriately displayed as plaintext you can reopen this ticket for those types, but comments on other mime-viewer related topics should be made on the appropriate ticket, or a new ticket if necessary.

comment:13 by vyt@…, 19 years ago

Cc: vyt@… added

It should be config option.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.