Bug 56194 - [PATCH] Retrieve properly Clipbard format tag for thumbnail
Summary: [PATCH] Retrieve properly Clipbard format tag for thumbnail
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HPSF (show other bugs)
Version: 3.10-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-27 13:29 UTC by thaichat04
Modified: 2014-07-24 19:34 UTC (History)
0 users



Attachments
thumbnail get tag patch (3.30 KB, text/plain)
2014-02-27 13:29 UTC, thaichat04
Details
sample file test (55.50 KB, application/vnd.ms-excel)
2014-04-29 12:13 UTC, thaichat04
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thaichat04 2014-02-27 13:29:35 UTC
Created attachment 31351 [details]
thumbnail get tag patch

As described in http://poi.apache.org/hpsf/thumbnails.html
tag value must be -1, -2 ,-3 or 0l

bu on lines 205 and 237 of org.apache.poi.hpsf.Thumbnail :
long clipboardFormatTag = LittleEndian.getUInt(getThumbnail(),
                                                       OFFSET_CFTAG);

Must be LittleEndian.getInt()
FF FF FF FF will be intepreted as -1 as expected, not ‘4294967295’.
Comment 1 Nick Burch 2014-04-29 09:01:27 UTC
Your patch seems to be missing the file test-data/hpsf/TestThumbnail.xls - we have the metadata of it, but not the contents...

Any chance you could attach that file? We can then apply the patch!
Comment 2 thaichat04 2014-04-29 12:13:47 UTC
Created attachment 31571 [details]
sample file test

Here's TestThumbnail.xls
Thanks
Comment 3 Nick Burch 2014-07-24 19:34:58 UTC
Thanks for the patch and file, applied (with minor tweaks) in r1613256.