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.
added r1884270