Patch #34969

Remove dependency on MimeMagic

Added by Go MAEDA 4 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Gems support
Target version:4.0.9

Description

In Redmine, MimeMagic is used to check that files with invalid formats are not passed to ImageMagick when generating thumbnail images with ImageMagick.

This patch replaces MimeMagic with Marcel, a gem bundled with Rails. The benefits of this change are as follows:

  • Simplifies the installation process: Due to a licensing issue, the MIME database freedesktop.org.xml was removed from MimeMagic. As a result, you have to make sure that your system has shared-mime-info before you install Redmine. Marcel bundles another database Apache Tika, so you don't have to install MIME database separately
  • Can reduce memory usage: By replacing MimeMagic with Marcel, we can reduce one gem dependency. Rails used to depend on MimeMagic, but in Rails 5.2.5 it no longer does. Now only Redmine itself depends on MimeMagic

0001-Remove-duplicate-code.patch Magnifier (1.18 KB) Go MAEDA, 2021-03-27 08:29

0002-Replace-MimeMagic-with-Marcel.patch Magnifier (1.56 KB) Go MAEDA, 2021-03-27 08:29


Related issues

Related to Redmine - Patch #34966: Update Rails to 5.2.5 Closed

Associated revisions

Revision 20861
Added by Go MAEDA 4 months ago

Remove duplicate code in Redmine::Thumbnail.generate (#34969).

Patch by Go MAEDA.

Revision 20862
Added by Go MAEDA 4 months ago

Replace MimeMagic with Marcel (#34969).

Patch by Go MAEDA.

Revision 20877
Added by Go MAEDA 4 months ago

Merged r20861 from trunk to 4.1-stable (#34969).

Revision 20878
Added by Go MAEDA 4 months ago

Merged r20862 from trunk to 4.1-stable (#34969).

Revision 20953
Added by Go MAEDA 3 months ago

Merged r20862 from trunk to 4.0-stable (#34969).

History

#1 Updated by Go MAEDA 4 months ago

#2 Updated by Go MAEDA 4 months ago

  • Target version set to 4.2.0

#3 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patches.

#4 Updated by Go MAEDA 4 months ago

  • Status changed from Closed to Reopened
  • Target version changed from 4.2.0 to 4.1.3

I think it is better to merge the change to older versions for the following reason. Keep using MimeMagic may cause installation trouble in some environments.

Go MAEDA wrote:

  • Simplifies the installation process: Due to a licensing issue, the MIME database freedesktop.org.xml was removed from MimeMagic. As a result, you have to make sure that your system has shared-mime-info before you install Redmine. Marcel bundles another database Apache Tika, so you don't have to install MIME database separately

#5 Updated by Go MAEDA 4 months ago

  • Status changed from Reopened to Closed

Backported to 4.1-stable in r20877 and r20878.

#6 Updated by Go MAEDA 3 months ago

  • Status changed from Closed to Reopened
  • Target version changed from 4.1.3 to 4.0.9

#8 Updated by Go MAEDA 3 months ago

  • Status changed from Reopened to Closed

Backported to 4.0-stable in r20953.

Also available in: Atom PDF