Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1360651 - [PATCH] Fix rst2odt generates ODT docs show 1st and 2nd images only
Summary: [PATCH] Fix rst2odt generates ODT docs show 1st and 2nd images only
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-docutils
Version: 26
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-27 09:00 UTC by Satoru SATOH
Modified: 2017-10-23 15:32 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-23 15:32:07 UTC


Attachments (Terms of Use)
An experimental pathc to make rst2odt generates unique draw:name attribute for each image elements (deleted)
2016-07-27 09:00 UTC, Satoru SATOH
no flags Details | Diff
A test file (deleted)
2016-07-27 09:01 UTC, Satoru SATOH
no flags Details
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements (deleted)
2017-02-07 09:08 UTC, Satoru SATOH
no flags Details | Diff
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements (2) (deleted)
2017-02-13 06:12 UTC, Satoru SATOH
no flags Details | Diff

Description Satoru SATOH 2016-07-27 09:00:35 UTC
Created attachment 1184545 [details]
An experimental pathc to make rst2odt generates unique draw:name attribute for each image elements

Description of problem:
It seems that rst2odt does not generate unique draw:name attribute for
each images embedded with '.. image::' or '.. figure::' directives,
and that causes strange problem that only 1st and 2nd images are shown
in generated ODT document.

I'll attach a simple test case found at [1] and an experimental fix
for this issue.


[1] http://stackoverflow.com/questions/36766905/rst2odt-not-showing-the-third-image
[2] https://bugs.documentfoundation.org/show_bug.cgi?id=96245


Version-Release number of selected component (if applicable):
python-docutils-0.12-0.6.20140510svn7747

How reproducible: Always


Steps to Reproduce:
1. Create test.rst (or download test.rst I'll attach)
2. rst2odt test.rst test.odt (build ODT file)
3. libreoffice test.odt (check)

Actual results:
test.odt only show 1st and 2nd images.

Expected results:
test.odt should show 3rd image also.

Additional info:
I guess that root causes is that rst2odt generates static const draw:name
attribute. I changed that and got expected results successfully.

Comment 1 Satoru SATOH 2016-07-27 09:01:39 UTC
Created attachment 1184546 [details]
A test file

Comment 2 Satoru SATOH 2016-07-27 09:04:07 UTC
Related RPMs: libreoffice-writer-5.1.5.1-2.fc24.x86_64, unoconv-0.7-3.fc24.noarch

Also https://bugs.documentfoundation.org/show_bug.cgi?id=96245 may be related.

Comment 3 Satoru SATOH 2017-02-07 09:07:15 UTC
It seems that this very annoying problem still exists in the latest one, python-docutils-0.12-0.7.20140510svn7747.fc25.noarch and also found in the upstream latest svn code.

I attached another experimental patch looks resolving this later.

Comment 4 Satoru SATOH 2017-02-07 09:08:40 UTC
Created attachment 1248317 [details]
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements

Comment 5 Satoru SATOH 2017-02-07 09:16:53 UTC
FYI. I reported this issue to the upstream also: https://sourceforge.net/p/docutils/bugs/306/

Comment 6 Satoru SATOH 2017-02-13 06:12:17 UTC
Created attachment 1249751 [details]
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements (2)

Almost same with the previous patch but made it applicable to python2-docutils-0.13.1-3.fc25.noarch.

Comment 7 Fedora End Of Life 2017-02-28 10:00:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 8 Kevin Fenzi 2017-10-22 19:32:45 UTC
Sorry this has languished so long. ;( 

I just build 0.14 in rawhide. I think it contains your patch. Do you need an update for stable releases? and can you confirm it's fixed in 0.14?

Comment 9 Satoru SATOH 2017-10-23 01:16:23 UTC
Sorry, I forgot to let you know about that. My patch was merged in the upstream, https://sourceforge.net/p/docutils/bugs/306/, so it's safe to close this.

Comment 10 Kevin Fenzi 2017-10-23 15:32:07 UTC
Great. Let us know if you need any stable updates or the like.


Note You need to log in before you can comment on or make changes to this bug.