Project

General

Profile

Actions

Feature #44362

open

Preview PDF compatible Adobe Illustrator files

Added by Go MAEDA 1 day ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Resolution:

Description

Adobe Illustrator saves .ai files with PDF compatibility by default, so the file is also a valid PDF file. Redmine already creates thumbnails for these files, but it cannot preview them.

Since #43484, Redmine detects the content type from the file contents, and it detects PDF compatible Illustrator files as application/illustrator. Redmine can rely on that content type to show the file in the PDF preview. Illustrator files saved in the older PostScript format are detected as application/postscript, and they are not previewed.

The attached patches:

  • 0001 moves the fallback for an undetermined content type into a new method, Redmine::MimeType.infer_type. AttachmentsController and IconsHelper both had the same code. The patch does not change any behavior, but 0002 depends on it, because attachments uploaded before #43484 may still have application/octet-stream as their content type.
  • 0002 changes Attachment#is_pdf? to look at the content type instead of the file name, and sends PDF compatible files as application/pdf so that browsers display them inline. Marcel treats application/illustrator as a subtype of application/pdf.
  • 0003 adds a dedicated icon for Illustrator files.

Files

No data to display

Actions

Also available in: Atom PDF