poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57552] XMLSlideShow.addPicture() finds the incorrect image
Date Tue, 28 Apr 2015 06:32:46 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=57552

--- Comment #5 from mark.o <Mark.Olesen@gmx.net> ---
Hi Andreas,

It'll take some time for me to put together a test pptx, but the
problem/solution are fairly quickly explained. When adding a picture, the code
examines the chksum of the existing pictures to decide if a new entry is needed
or an existing media can be reused. With the current code, the media will be
listed in lexical order (eg, image1.png, image10.png, image11.png, image2.png,
image20.png, image3.png, ...). If the picture to be added already exists, the
0-based index in the list is returned and (later) changed to a 1-based index
for the referencing. This results in total rubbish.

For the small example, the original image10.png is found as index 2 in the list
(0-based), which becomes index 3 (1-based) for the slide reference. The slide
will thus now reference /media/image3.png !!

The current code will only work properly if you have a maximum of 9 images.

The patch introduces a (case-insensitive) alpha-numerical comparator so that
the list is ordered as (image1.png, image2.png, ... image10.png, image11.png
...) which re-establishes the proper connection between the indices.

/mark

-- 
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


Mime
View raw message