Bug 64972

Summary: HSSFPictureData#getPictureType() disagrees with documented interface
Product: POI Reporter: Marius Volkhart <marius>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 4.1.2-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Marius Volkhart 2020-12-09 19:57:28 UTC
HSSFPictureData#getPictureType() is documented as returning -1 if the image type is unknown. However, the interface, PictureData, which HssfPictureData implements, documents that function as returning 0 if the image type is unknown. 

XSSFPictureData follows the interface spec.

I don't know what POI's policy is on interface implementations, but I would think HSSFPictureData should match the documented behavior, or the documentation should be updated to something like "0 or less" if the type is unknown.

There was previous discussion around a switch to enums for this method on XWPFPictureData: https://bz.apache.org/bugzilla/show_bug.cgi?id=59836 but it looks like that change wasn't made.
Comment 1 PJ Fanning 2020-12-09 21:03:35 UTC
added r1884270