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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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

Aurélien <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
                   |                            |m
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60499

Andreas Beeker <[hidden email]> changed:

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

--- Comment #1 from Andreas Beeker <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]