Bug 39991

Summary: HSLF: pictures in the stream identified by offset, not by UID
Product: POI Reporter: Yegor Kozlov <yegor>
Component: HSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: patch with the fix
org.apache.poi.hslf.model.Picture
org.apache.poi.hslf.usermodel.PictureData
org.apache.poi.hslf.usermodel.PictureData
org.apache.poi.hslf.model.Picture
patch with the fix
org.apache.poi.hslf.usermodel.SlideShow

Description Yegor Kozlov 2006-07-07 14:17:40 UTC
Pictures in the stream are identified by the offset which is stored in
EscherBSERecord.
Current code finds image data by its 16-byte checksum (UID). It doesn't work in 
all cases. I have a sample created on MAC where the UID stored in the
EscherBSERecord and
the UID in the Pictures OLE stream are not the same. 

Idea to find images by offset is much better and works in all cases.

Yegor
Comment 1 Yegor Kozlov 2006-07-07 14:18:13 UTC
Created attachment 18571 [details]
patch with the fix
Comment 2 Yegor Kozlov 2006-07-07 14:18:45 UTC
Created attachment 18572 [details]
org.apache.poi.hslf.model.Picture
Comment 3 Yegor Kozlov 2006-07-07 14:19:06 UTC
Created attachment 18573 [details]
org.apache.poi.hslf.usermodel.PictureData
Comment 4 Nick Burch 2006-07-13 09:39:19 UTC
Just went to commit this, but the test "usermodel.TestPictures" fails

It seems that PictureData just has 0 for the offset. Is there another patch
we're missing, to correctly populate that?
Comment 5 Yegor Kozlov 2006-07-14 06:13:20 UTC
Created attachment 18600 [details]
org.apache.poi.hslf.usermodel.PictureData
Comment 6 Yegor Kozlov 2006-07-14 06:13:50 UTC
Created attachment 18601 [details]
org.apache.poi.hslf.model.Picture
Comment 7 Yegor Kozlov 2006-07-14 06:14:09 UTC
Created attachment 18602 [details]
patch with the fix
Comment 8 Yegor Kozlov 2006-07-14 06:15:03 UTC
Created attachment 18603 [details]
org.apache.poi.hslf.usermodel.SlideShow
Comment 9 Yegor Kozlov 2006-07-14 06:16:40 UTC
My bad.
I re-attached the patch and modified files.
Now it should work fine.

Yegor
Comment 10 Nick Burch 2006-07-14 09:17:20 UTC
That one looks happier :)

Thanks for these patches, I've committed them.