Actions
Feature #44362
openPreview PDF compatible Adobe Illustrator files
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 asapplication/pdfso that browsers display them inline. Marcel treatsapplication/illustratoras a subtype ofapplication/pdf. - 0003 adds a dedicated icon for Illustrator files.
Files
No data to display
Actions