Defect #28125

PNG images on a wiki page don't appear in exported PDF

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

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

0%

Category:PDF export
Target version:3.3.9
Resolution:Fixed Affected version:

Description

Please see the following screenshot. The wiki page has 2 inline images, but the PNG image (Redmine logo) doesn't appear in exported PDF.

Environment:
  Redmine version                3.4.4.devel.17194
  Ruby version                   2.3.3-p222 (2016-11-21) [x86_64-darwin16]
  Rails version                  5.1.4
  Environment                    development
  Database adapter               SQLite
SCM:
  Subversion                     1.9.7
  Mercurial                      4.3.1
  Cvs                            1.12.13
  Bazaar                         2.7.0
  Git                            2.14.3
  Filesystem                     
Redmine plugins:
  no plugin installed

The PNG image which I used for test is this one: http://www.redmine.org/attachments/download/3458/redmine_logo_v1.png

inline-png-does-not-appear-on-pdf.png (104 KB) Go MAEDA, 2018-02-02 08:25

pdf_export.png (364 KB) Jun NAITOH, 2018-03-25 09:16

Example of bug.png (143 KB) T H, 2018-06-06 14:16

Zrzut ekranu z 2018-06-18 12-00-42.png (40.3 KB) Pawel Szafer, 2018-06-18 12:00

Zrzut ekranu z 2018-06-18 12-01-11.png (383 KB) Pawel Szafer, 2018-06-18 12:01

Zrzut ekranu z 2018-06-18 12-01-38.png (15.8 KB) Pawel Szafer, 2018-06-18 12:01

2.Copy_and_Crop_with_Gimp2.png (368 KB) Kuniharu AKAHANE, 2018-06-25 08:48

1.Microsoft_SnippingTool.png (516 KB) Kuniharu AKAHANE, 2018-06-25 08:49

3.Use_Clip_and_Paste_Plugin_v1.10_on_Redmine3.3.png (394 KB) Kuniharu AKAHANE, 2018-06-25 08:54

Associated revisions

Revision 17405
Added by Go MAEDA 3 months ago

Update rbpdf gem to 1.19.4 (#28125).

Contributed by Jun NAITOH.

Revision 17408
Added by Go MAEDA 3 months ago

Merged r17405 from trunk to 3.4-stable (#28125).

Revision 17409
Added by Go MAEDA 3 months ago

Merged r17405 from trunk to 3.3-stable (#28125).

Revision 17414
Added by Go MAEDA 3 months ago

Update rbpdf gem to 1.19.5 (#28125).

Contributed by Jun NAITOH.

Revision 17415
Added by Go MAEDA 3 months ago

Merged r17414 from trunk to 3.4-stable (#28125).

Revision 17416
Added by Go MAEDA 3 months ago

Merged r17414 from trunk to 3.3-stable (#28125).

History

#1 Updated by Jun NAITOH 6 months ago

I can't reproduce this issue.
Are there any conditions for reproducing?

$ ruby bin/about

sh: darcs: command not found
sh: bzr: command not found
Environment:
  Redmine version                3.4.4.stable
  Ruby version                   2.1.2-p95 (2014-05-08) [i686-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               SQLite
SCM:
  Subversion                     1.6.11
  Mercurial                      1.4
  Git                            1.7.12.4
  Filesystem                     
Redmine plugins:
  no plugin installed

#2 Updated by Pawel Szafer 4 months ago

Same issue as author. Can I somehow help to investigate it?

Only error in logs I see is:

pdf: Image: error: RBPDF error: Image filename is empty.

It is repeated for each image

#3 Updated by Jun NAITOH 4 months ago

Pawel Szafer wrote:

Same issue as author. Can I somehow help to investigate it?

How do you describe the contents of the wiki?

Only error in logs I see is:

pdf: Image: error: RBPDF error: Image filename is empty.

It is repeated for each image

The cause is unknown, but the image does not seem to be found.
Is Wiki notation textile or markdown?

#4 Updated by Pawel Szafer 4 months ago

I've tested both notations textile and markdown.

How do you describe the contents of the wiki?

Don't understand what you mean, but it is mostly markdown text with png images in it. I removed alpha channel from PNG but without any luck.
Installed redmine on Arch Linux and Alpine Linux already.

I can give it a try and make Dockerfile if that helps somehow.

#5 Updated by Xavier Poncet 4 months ago

Hello, I confirm this trouble. since we have update from 3.2.1 to 3.4.5
I've exactly the same problem, no png appears in the exported wiki page but jpg are visible.
I will add that we noticed a considerable size increase in exported pdf file with the PNG!

#6 Updated by T H 4 months ago

I noticed this bug in our installation as well. Embedding images in the browser works well, but PDF export results in PNG images not showing correctly. It seems as though only the alpha channel is rendered in the PDF – is that plausible? I did not see any errors or warnings in our logs. A screenshot of the resulting PDF (in Adobe Reader) is attached. (The alpha channel is basically a slight shadow around the PNG image, which is rendered in stark contrast in the PDF.)

Our redmine setup is as follows:

Environment:
  Redmine version                3.4.4.stable.17194
  Ruby version                   2.4.1-p111 (2017-03-22) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.3
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  clipboard_image_paste          1.12
  redmine_checklists             3.1.9
  redmine_editauthor             0.11.0
  redmine_highlightjs            1.0.3
  redmine_lightbox2              0.4.3
  redmine_mentions               0.0.1
  redmine_percent_done           1.1.0
  redmine_tags                   3.2.2

We are using Markdown syntax.

Please let me know if I can provide any other helpful information.

#7 Updated by Jun NAITOH 4 months ago

I was able to reproduce this problem.

The cause of this problem is rmagick.
But, the implementation of RBPDF also has a problem and will be fixed.

I have created RBPDF's issue.
https://github.com/naitoh/rbpdf/issues/44

#8 Updated by Jun NAITOH 3 months ago

This problem fixed by rbpdf 1.19.4.
please bundle update.

#9 Updated by Xavier Poncet 3 months ago

tested right now after bundle update, it's ok for we with redmine 3.4.5 stable, it works !

#10 Updated by Go MAEDA 3 months ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Target version set to 3.3.9

#11 Updated by Pawel Szafer 3 months ago

bundle update and restart webserver should be enough?
For me it is not working...

# gem list
rbpdf (1.19.4)
rbpdf-font (1.19.1)

Same bug still:

pdf: Image: error: RBPDF error: Image filename is empty.

#12 Updated by Jun NAITOH 3 months ago

Pawel Szafer wrote:

bundle update and restart webserver should be enough?

Yes.

For me it is not working...
Same bug still:

pdf: Image: error: RBPDF error: Image filename is empty.

I can't reproduce this message.

Please tell me the followings.

  • An image in which the probrem occurs.
  • Your environment. (OS, x86 or x64, ruby version, rmagick version, Imagemagick version)

#13 Updated by Pawel Szafer 3 months ago

Jun NAITOH wrote:

Pawel Szafer wrote:

bundle update and restart webserver should be enough?

Yes.

For me it is not working...
Same bug still:

pdf: Image: error: RBPDF error: Image filename is empty.

I can't reproduce this message.

Please tell me the followings.

  • An image in which the probrem occurs.

All three images I attached in post above are problematic.
changed name of last image (with white background and Test sign) to 'test.png' and it is working...
For rest of images, which are more complex name changing doesn't help really.

  • Your environment. (OS, x86 or x64, ruby version, rmagick version, Imagemagick version)

My env.

What version
OS Alpine OS x64
Kernel 4.15.17-1-pve
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux-musl]
rails 4.2.8
redmine 3.4.5.stable
ImageMagick ImageMagick 7.0.7-11 Q16 x86_64
Rmagick rmagick (2.16.0)
RBPDF 1.19.4
rbpdf-font 1.19.1

#14 Updated by Jun NAITOH 3 months ago

My env.

What version
OS Alpine OS x64
Kernel 4.15.17-1-pve
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux-musl]
ImageMagick ImageMagick 7.0.7-11 Q16 x86_64
Rmagick rmagick (2.16.0)

Thanks your information.

I tried installing RMagick on Alpine Linux v3.7(x86_64) Extended.

But RMagick (2.16.0) does not seem to support ImageMagick 7.
Is not it a problem with your environment?

# uname -a
Linux alp 4.9.65-1-hardened #2-Alpine SMP Mon Nov 27 15:36:10 GMT 2017 x86_64 Linux
# ruby -v
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux-musl]
# bundle install --without development test
 :
 (snip)
 :
Installing rmagick 2.16.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.4.0/gems/rmagick-2.16.0/ext/RMagick
/usr/bin/ruby -r ./siteconf20180621-23353-1k7c7k9.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
checking for pkg-config... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
Package 'MagickCore', required by 'virtual:world', not found

Warning: Found a partial ImageMagick installation. Your operating system likely has some built-in ImageMagick libraries but not all of ImageMagick. This will most likely
cause problems at both compile and runtime.
Found partial installation at: /usr
checking for outdated ImageMagick version (<= 6.4.9)... *** extconf.rb failed ***
# apk info imagemagick
imagemagick-7.0.7.11-r1 description:

#15 Updated by Pawel Szafer 3 months ago

Check it out: http://ec2-35-158-221-148.eu-central-1.compute.amazonaws.com:8080/projects/test/wiki/Wiki
I can give you access to ssh, contact me by e-mail for that.

This is what I installed on Alpine:

  - name: Install Redmine deps from APK
    apk:
      name: "{{ item }}" 
      state: latest
    with_items:
      - ruby-rmagick
      - ruby-json
      - ruby-bigdecimal
      - ruby-rdoc
      - ruby-ffi
      - tzdata
      - git
      - mysql-client
      - mariadb-client-libs
      - mariadb-dev
      - imagemagick
      - imagemagick-c++
      - imagemagick-dev
      - imagemagick-libs
      - imagemagick6-libs
      - coreutils
      - libatomic
      - readline
      - readline-dev
      - libxml2
      - libxml2-dev
      - libxml2-utils
      - ncurses-terminfo-base
      - ncurses-terminfo
      - libxslt
      - libxslt-dev
      - zlib-dev
      - zlib
      - ruby
      - yaml
      - yaml-dev
      - libffi-dev
      - build-base
      - nodejs
      - ruby-io-console
      - ruby-irb
      - ruby-rake
      - make
      - gcc
      - g++
      - libffi-dev
      - ruby-dev

#16 Updated by Jun NAITOH 3 months ago

I fixed it with rbpdf 1.19.4, but since the fix was incorrect, I released rbpdf 1.19.5.
please bundle update.

The fixed issues is as follows.

I can give you access to ssh, contact me by e-mail for that.

I used your environment.
Thanks to Mr. Pawel Szafer.

#17 Updated by Pawel Szafer 3 months ago

I can confirm that now images are exported correctly.
Thank you very much!

#18 Updated by Kuniharu AKAHANE 3 months ago

Hi,

After bundle update and Redmine app restart, rbpdf 1.19.5 works fine and all png images exported to pdf correctly on our environment.
Thank you for your time and effort, Naito san, Maeda san and Mr.Pawel Szafer.

  • Just for your infomation, and

#19 Updated by Go MAEDA 3 months ago

  • Status changed from Resolved to Closed
  • Resolution set to Fixed

Updated the Gemfile. Thank you all for the contribution!

Also available in: Atom PDF