プロジェクト

全般

プロフィール

Vote #77321

完了

Images with non-ASCII file names are not shown in PDF

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
PDF export_39
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
39
version_id:
126
issue_org_id:
22335
author_id:
332
assigned_to_id:
0
comments:
11
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Images with non-ASCII file names are not shown in PDF. Please see the following image. There are two embedded image "shrine.jpg" and "神社.jpg" in a issue description. But "神社.jpg" (an image with non-ASCII file name) are not shown in exported PDF.

!defect-description.jpg!


journals

Hi, Go Maeda.
Thanks for reporting this issue here.
I reproduced this issue on our site.

Just for your information,

Not only images with non-ASCII file names but also with ASCII file names which includes special characters are not shown in PDF.
I guess url-encoding or url-handling of file-path cause this issue. (somewhere in rbpdf ?)

Examples:
<pre>
# cherryblossoms.png
!cherryblossoms.png!
# cherry blossoms.png (include space character, not shown )
!cherry blossoms.png!
# cherry%20blossoms.png (include space character with url encoded, shown in browser but not in PDF)
!cherry%20blossoms.png!
</pre>

{{collapse(Show results)
* On browser
!browser_view.png!

* Exported PDF
!exported_pdf.png!
}}

{{collapse(Show logs on our web-site)
> Started GET "/its/issues/196178.pdf" for <ipaddress> at 2016-07-14 14:17:42 +0900
> Processing by IssuesController#show as PDF
> Parameters: {"id"=>"196178"}
> Current user: kakahane (id=***)
> *pdf: Image: error: RBPDF error: Image filename is empty.*
> *pdf: Image: error: RBPDF error: Image filename is empty.*
> Rendered issues/show.pdf.erb (88.5ms)
> Completed 200 OK in 106ms (Views: 88.3ms | ActiveRecord: 3.0ms)
> Out-Of-Bound GC finished in 0.115697521 sec
}}

{{collapse(Repoduced Environment-1)
<pre>
$ uname -a
Linux 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)

Environment:
Redmine version 3.0.7.stable
Ruby version 2.1.7-p400 (2015-08-18) [x86_64-linux]
Rails version 4.2.3
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.14
Mercurial 2.6.2
Git 2.6.4
Filesystem
Redmine plugins:
clipboard_image_paste 1.10
redmine_exception_handler 2.0.0.devel.56f6d28645
redmine_importer 1.2.2
redmine_plugin_views_revisions 0.0.1
redmine_vividtone_my_page_blocks 20150614
redmine_work_time 0.3.1
redmine_xls_export 0.2.1.t8
wiki_external_filter 0.0.2

Gems:
htmlentities (4.3.1)
passenger (4.0.59)
rbpdf (1.18.7, 1.18.6)
rmagick (2.13.4)
</pre>
}}

{{collapse(Repoduced Environment-2)
<pre>
$ uname -a
Linux 2.6.32-573.22.1.el6.x86_64 #1 SMP Wed Mar 23 03:35:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/centos-release
CentOS release 6.7 (Final)

Environment:
Redmine version 3.1.4.stable
Ruby version 2.2.4-p230 (2015-12-16) [x86_64-linux]
Rails version 4.2.5.2
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.15
Mercurial 1.4
Git 1.7.1
Filesystem
Redmine plugins:
clipboard_image_paste 1.10
redmine_exception_handler 2.0.0.devel.56f6d28645
redmine_importer 1.2.2
redmine_plugin_views_revisions 0.0.1
redmine_vividtone_my_page_blocks 20150614
redmine_work_time 0.3.1
redmine_xls_export 0.2.1.t9
wiki_external_filter 0.0.2
Gems:
htmlentities (4.3.1)
passenger (5.0.27)
rbpdf (1.18.7)
rmagick (2.15.4)
</pre>
}}
--------------------------------------------------------------------------------
Opps, Add captured images.
--------------------------------------------------------------------------------
This problem fixed by rbpdf 1.19.1.
please bundle update.
--------------------------------------------------------------------------------
Thanks you very much for your time, naito-san.

I tried rbpdf 1.19.1 on our all redmine instanses.
The problem seems to be fixed so far.

Environment:
<pre>
Redmine version 3.3.2.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
</pre>

bundle update results:
<pre>
Using rbpdf-font 1.19.1 (was 1.19.0)
Using rbpdf 1.19.1 (was 1.19.0)
</pre>
--------------------------------------------------------------------------------
I confirmed that images with a file name which contains non-ASCII and whitespace characters is rendered properly after updating to rfpdf 1.19.1 by executing @bundle update@.

attachment:22335-with-rfpdf-1.19.1.pdf

Thank you for working on this, Naitoh-san. We can close this issue.

---

Note for those who are in trouble with this problem:

Please run the following commands on your Redmine server.

<pre>
cd /path/to/redmine
bundle update
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed with rbpdf 1.19.2.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリPDF export_39 にセット
  • 対象バージョン3.2.6_126 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0