From 93c8c1540e3b04202289c942ef0d5621f4754312 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 9 Dec 2020 21:03:15 +0000 Subject: [PATCH] [bug-64972] HSSFPictureData#getPictureType() should return 0 for unknown picture type (to be consistent with other implementations) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884270 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java index 0bac1af0f6..4b7ee376fb 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java @@ -121,7 +121,8 @@ public class HSSFPictureData implements PictureData } /** - * @return the POI internal image type, -1 if not unknown image type + * @return the POI internal image type, 0 if not unknown image type (was -1 prior to 5.0.0 but + * that was inconsistent with other {@link PictureData} implementations) * * @see Workbook#PICTURE_TYPE_DIB * @see Workbook#PICTURE_TYPE_EMF @@ -145,7 +146,7 @@ public class HSSFPictureData implements PictureData case BLIP_DIB: return Workbook.PICTURE_TYPE_DIB; default: - return -1; + return 0; } } } -- 2.39.5