Vote #79121
完了PNG images on a wiki page don't appear in exported PDF
0%
説明
Please see the following screenshot. The wiki page has 2 inline images, but the PNG image (Redmine logo) doesn't appear in exported PDF.
!{border: 1px solid #ccc;}.inline-png-does-not-appear-on-pdf.png!
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
journals
I can't reproduce this issue.
Are there any conditions for reproducing?
!pdf_export.png!
<pre>
$ 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
</pre>
--------------------------------------------------------------------------------
Same issue as author. Can I somehow help to investigate it?
Only error in logs I see is:
<pre>
pdf: Image: error: RBPDF error: Image filename is empty.
</pre>
It is repeated for each image
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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!
--------------------------------------------------------------------------------
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:
<pre>
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
</pre>
We are using Markdown syntax.
Please let me know if I can provide any other helpful information.
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
This problem fixed by rbpdf 1.19.4.
please bundle update.
--------------------------------------------------------------------------------
tested right now after bundle update, it's ok for we with redmine 3.4.5 stable, it works !
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
bundle update and restart webserver should be enough?
For me it is not working...
<pre>
# gem list
rbpdf (1.19.4)
rbpdf-font (1.19.1)
</pre>
Same bug still:
<pre>
pdf: Image: error: RBPDF error: Image filename is empty.
</pre>
!https://www.redmine.org/attachments/download/20902/Zrzut%20ekranu%20z%202018-06-18%2012-00-42.png!
!https://www.redmine.org/attachments/download/20903/Zrzut%20ekranu%20z%202018-06-18%2012-01-11.png!
!https://www.redmine.org/attachments/download/20904/Zrzut%20ekranu%20z%202018-06-18%2012-01-38.png!
--------------------------------------------------------------------------------
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)
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
> 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.
* https://www.alpinelinux.org/downloads/
But RMagick (2.16.0) does not seem to support ImageMagick 7.
Is not it a problem with your environment?
<pre>
# 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 ***
</pre>
<pre>
# apk info imagemagick
imagemagick-7.0.7.11-r1 description:
</pre>
--------------------------------------------------------------------------------
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:
<pre>
- 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
</pre>
--------------------------------------------------------------------------------
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.
* https://github.com/naitoh/rbpdf/issues/45
* https://github.com/naitoh/rbpdf/issues/46
> I can give you access to ssh, contact me by e-mail for that.
I used your environment.
Thanks to Mr. Pawel Szafer.
--------------------------------------------------------------------------------
I can confirm that now images are exported correctly.
Thank you very much!
--------------------------------------------------------------------------------
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, {{collapse(Tested Environment)
- CentOS Linux release 7.4.1708 (Core)
- Version: ImageMagick 6.7.8-9 2016-06-16 Q16
- rmagick (2.16.0)
Redmine Environment:
Redmine version 3.3.8.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
Redmine plugins:
clipboard_image_paste 1.10
}} and
{{collapse(Affected alpha 1-bit png images on our site)
** 1.Microsoft_SnippingTool.png
!1.Microsoft_SnippingTool.png!
<pre>
$ identify -verbose 1.Microsoft_SnippingTool.png
Image: 1.Microsoft_SnippingTool.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 602x402+0+0
Resolution: 47.24x47.24
Print size: 12.7434x8.50974
Units: PixelsPerCentimeter
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
*alpha: 1-bit*
</pre>
** 2.Copy_and_Crop_with_Gimp2.png
!2.Copy_and_Crop_with_Gimp2.png!
<pre>
$ identify -verbose 2.Copy_and_Crop_with_Gimp2.png
Image: 2.Copy_and_Crop_with_Gimp2.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 600x396+0+0
Resolution: 28.35x28.35
Print size: 21.164x13.9683
Units: PixelsPerCentimeter
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
*alpha: 1-bit*
</pre>
** 3.Use_Clip_and_Paste_Plugin_v1.10_on_Redmine3.3.png
!3.Use_Clip_and_Paste_Plugin_v1.10_on_Redmine3.3.png!
<pre>
$ identify -verbose 3.Use_Clip_and_Paste_Plugin_v1.10_on_Redmine3.3.png
Image: 3.Use_Clip_and_Paste_Plugin_v1.10_on_Redmine3.3.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 599x400+0+0
Resolution: 72x72
Print size: 8.31944x5.55556
Units: Undefined
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
*alpha: 1-bit*
</pre>
}}
--------------------------------------------------------------------------------
Updated the Gemfile. Thank you all for the contribution!
--------------------------------------------------------------------------------