You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2016/12/20 10:02:57 UTC

[Bug 60499] New: Deleting a picture that is used twice on a slide corrupt the slide

https://bz.apache.org/bugzilla/show_bug.cgi?id=60499

            Bug ID: 60499
           Summary: Deleting a picture that is used twice on a slide
                    corrupt the slide
           Product: POI
           Version: 3.16-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: dev@poi.apache.org
          Reporter: amanteaux+bzapache@gmail.com
  Target Milestone: ---

Created attachment 34536
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34536&action=edit
A test PPT with an image used twice, and a java code with a main to reproduce
the problem

If the same picture is referenced twice in a slide (with 2 XSLFPictureShape),
deleting one of the XSLFPictureShape will corrupt the slide. By corrupted, I
mean that PowerPoint won't be able to load the slide and it will replace its
content with a blank slide.
I am guessing that XSLF always deletes the image file along with the
XSLFPictureShape. What should be done is deleting the image file only if it is
not used by other XSLFPictureShape elements.

To create a slide with the same picture referenced twice:
1. insert a picture in a slide,
2. copy and past the inserted picture in the current slide.
The same picture should be duplicated in the slide.

I have put attached a zip file with:
- a PPT with one slide and an image used twice in that slide,
- a java class with a small main() to reproduce the probleme.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60499] Deleting a picture that is used twice on a slide corrupt the slide

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60499

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
I regard the original issue as invalid - if you have multiple references to the
same part (e.g. a png image), you would have each time a new relationship -
i.e. relationships aren't reused. I have to admit, that I haven't search the
ECMA spec for this definition, but if you do the same manually via MS/Libre
Office you actually get not only a copied relationship but also a second media
part.

After I adopted your sample to this handling, the resulting pptx was still
corrupt as the POIXMLDocumentPart.removeRelation(POIXMLDocumentPart) method
didn't handle multiple references correct.

This was fixed via r1808661

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60499] Deleting a picture that is used twice on a slide corrupt the slide

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60499

Aurélien <am...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amanteaux+bzapache@gmail.co
                   |                            |m
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org