Project

General

Profile

Actions

Defect #42558

closed

JPEG images are not shown in exported PDF files

Added by E M about 1 month ago. Updated 9 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Wiki
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

After a migration from 5.x to 6.x + upgrade Ruby to 3.3, the images are no more exported in PDF. (I'm an old user of redmine, beginning 10 years ago)

The details of my installation are in attachment. The OS is a Debian Bookworm up to date. The ruby is installed by rvm. The nginx Passenger is compiled from ruby with passenger-install-nginx-module.
All other functionalities I use are working.

From the logs files, I find the error message:
App 71932 output: [2bb7c937-74d9-418f-833c-9962d359a8fd] Started GET "/projects/test/wiki/Wiki.pdf" for 192.168.121.1 at 2025-04-10 10:32:34 +0200
App 71932 output: [2bb7c937-74d9-418f-833c-9962d359a8fd] Processing by WikiController#show as PDF
App 71932 output: [2bb7c937-74d9-418f-833c-9962d359a8fd] Parameters: {"project_id"=>"test", "id"=>"Wiki"}
App 71932 output: [2bb7c937-74d9-418f-833c-9962d359a8fd] Current user: admin (id=1)
App 71932 output: [2bb7c937-74d9-418f-833c-9962d359a8fd] pdf: Image: error: `mogrify -mime-type /tmp/mini_magick20250410-71932-pevnj7.jpg` failed with status: 1 and error:
App 71932 output: mogrify-im6.q16: unrecognized option `-mime-type' @ error/mogrify.c/MogrifyImageCommand/5538.
App 71932 output:
App 71932 output: [2bb7c937-74d9-418f-833c-9962d359a8fd] Completed 200 OK in 225ms (Views: 205.7ms | ActiveRecord: 5.5ms (14 queries, 1 cached) | GC: 29.9ms)

I suspect the migration of rmagick but without finding anything. That's why I need help !

Thanks for your support and long life to redmine


Files


Related issues

Related to Redmine - Patch #41312: Update MiniMagick to 5.0ClosedGo MAEDA

Actions
Actions #1

Updated by E M about 1 month ago

The error message "pdf: Image: error:" appear only in rbpdf librairy [[https://github.com/naitoh/rbpdf/blob/49e4064286cdf5bdb783dbd2d71b8793d8e34e49/lib/rbpdf.rb#L15127]]

As I don't understand ruby code, I don't see from where the command line comes from.

Hope it helps !

Eric

Actions #2

Updated by E M 29 days ago

Always the same with ruby 3.3.8 + redmine 6.0.4: jpg are not exported in the pdf with same error.
With ruby 2.x, I got the same error either.

=> the migration to redmine 6.x is the main issue

Actions #3

Updated by E M 29 days ago

export of png images is working. The issue focus on jpg/jpeg format.

Actions #4

Updated by Jens Krämer 20 days ago

I see you already opened an issue with RBPDF (https://github.com/naitoh/rbpdf/issues/102), which I think is the right place to address this.

As a workaround, you could revert the mini_magick version to a version < 5.0 in your Gemfile:

group :minimagick do
  gem 'mini_magick', '< 5.0'
end

Run bundle update mini_magick after making that change to update Gemfile.lock

Actions #5

Updated by Felix Heller 16 days ago

E M wrote in #note-3:

export of png images is working. The issue focus on jpg/jpeg format.

I have the same error unrecognized option `-mime-type' after updating to Redmine 6.0.4.
I can confirm that using a PNG image instead of a JPEG image works as a workaround. Thank you for your idea.

Actions #6

Updated by Jun NAITOH 15 days ago

Jens Krämer wrote in #note-4:

I see you already opened an issue with RBPDF (https://github.com/naitoh/rbpdf/issues/102), which I think is the right place to address this.

As a workaround, you could revert the mini_magick version to a version < 5.0 in your Gemfile:

I have added mini_magick 5.0 support in rbpdf 1.21.4.
Please bundle update .

Actions #7

Updated by Go MAEDA 15 days ago

  • Subject changed from PDF export without image to JPEG images are not shown in exported PDF files
  • Target version set to 6.0.6

Jun NAITOH wrote in #note-6:

I have added mini_magick 5.0 support in rbpdf 1.21.4.
Please bundle update .

Thank you for updating rbpdf gem. I am going to commit the following change as a fix for this issue:

diff --git a/Gemfile b/Gemfile
index 6dbc733ec..e979abf83 100644
--- a/Gemfile
+++ b/Gemfile
@@ -11,7 +11,7 @@ gem 'marcel'
 gem 'mail', '~> 2.8.1'
 gem 'nokogiri', '~> 1.18.3'
 gem 'i18n', '~> 1.14.1'
-gem 'rbpdf', '~> 1.21.3'
+gem 'rbpdf', '~> 1.21.4'
 gem 'addressable'
 gem 'rubyzip', '~> 2.4.0'
 gem 'propshaft', '~> 1.1.0'
Actions #8

Updated by Go MAEDA 15 days ago

Actions #9

Updated by Go MAEDA 14 days ago

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

Committed the change in r23748.

Actions #10

Updated by Go MAEDA 13 days ago

  • Status changed from Resolved to Closed

Merged the change into 6.0-stable branch in r23751.

Actions #11

Updated by E M 9 days ago

issue resolved: thanks a lot!

Actions

Also available in: Atom PDF