Project

General

Profile

Actions

Defect #44335

closed

PDF preview of .ai attachments triggers an automatic download

Added by Katsuya HIDAKA 23 days ago. Updated 12 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
Resolution:
Fixed
Affected version:

Description

When an Adobe Illustrator (.ai) file is attached to an issue, opening the attachment details immediately starts a download. Clicking “Open in full view” also starts a download.

The likely cause is the filename-based PDF preview detection:

  • Attachment#is_pdf? determines the file type from the filename using Redmine::MimeType.of.
  • MiniMime maps the .ai extension to application/pdf, so .ai attachments are rendered using the PDF preview.

Files


Related issues

Related to Redmine - Feature #44385: Replace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookupClosedGo MAEDAActions
Actions #1

Updated by Go MAEDA 19 days ago

  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release
Actions #2

Updated by Go MAEDA 18 days ago

Patch attached.

The issue is fixed by making Redmine::MimeType returns application/illustrator instead of application/pdf for the .ai extension. application/illustrator is not registered with IANA, but it is the type Marcel returns for this extension, and Marcel is already used in Redmine.

Adobe Illustrator files had thumbnails only because Redmine::MimeType reported them as PDF. This patch keeps them working by checking the content type explicitly in Attachment#thumbnailable?.

Actions #3

Updated by Go MAEDA 15 days ago

  • Target version changed from Candidate for next minor release to 7.0.1

Setting the target version to 7.0.1.

Actions #4

Updated by Katsuya HIDAKA 15 days ago

The patch looks good. I confirmed that it resolves the automatic download issue for .ai attachments, while thumbnails for PDF-compatible .ai files continue to be generated.

Actions #5

Updated by Go MAEDA 13 days ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix in r24946. Thank you for reporting the issue.

Actions #6

Updated by Go MAEDA 12 days ago

  • Status changed from Resolved to Closed

Merged the fix into 7.0-stable branch in r24965.

Actions #7

Updated by Go MAEDA 4 days ago

  • Related to Feature #44385: Replace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookup added
Actions

Also available in: Atom PDF