mirror of https://github.com/apache/poi.git
Tweak hssf and hwpf image mime types for wmf/emf to match those used by XSSF/XWPF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@995943 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cf8be77aee
commit
7c17469fae
|
@ -106,9 +106,9 @@ public class HSSFPictureData implements PictureData
|
||||||
public String getMimeType() {
|
public String getMimeType() {
|
||||||
switch (blip.getRecordId()) {
|
switch (blip.getRecordId()) {
|
||||||
case EscherMetafileBlip.RECORD_ID_WMF:
|
case EscherMetafileBlip.RECORD_ID_WMF:
|
||||||
return "application/x-wmf";
|
return "image/x-wmf";
|
||||||
case EscherMetafileBlip.RECORD_ID_EMF:
|
case EscherMetafileBlip.RECORD_ID_EMF:
|
||||||
return "application/x-emf";
|
return "image/x-emf";
|
||||||
case EscherMetafileBlip.RECORD_ID_PICT:
|
case EscherMetafileBlip.RECORD_ID_PICT:
|
||||||
return "image/x-pict";
|
return "image/x-pict";
|
||||||
case EscherBitmapBlip.RECORD_ID_PNG:
|
case EscherBitmapBlip.RECORD_ID_PNG:
|
||||||
|
|
|
@ -236,10 +236,10 @@ public final class Picture
|
||||||
return "image/tiff";
|
return "image/tiff";
|
||||||
}
|
}
|
||||||
if("wmf".equals(extension)) {
|
if("wmf".equals(extension)) {
|
||||||
return "application/x-wmf";
|
return "image/x-wmf";
|
||||||
}
|
}
|
||||||
if("emf".equals(extension)) {
|
if("emf".equals(extension)) {
|
||||||
return "application/x-emf";
|
return "image/x-emf";
|
||||||
}
|
}
|
||||||
return "image/unknown";
|
return "image/unknown";
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public final class TestPictures extends TestCase {
|
||||||
assertEquals("png", pics.get(4).suggestFileExtension());
|
assertEquals("png", pics.get(4).suggestFileExtension());
|
||||||
assertEquals("image/png", pics.get(4).getMimeType());
|
assertEquals("image/png", pics.get(4).getMimeType());
|
||||||
assertEquals("wmf", pics.get(5).suggestFileExtension());
|
assertEquals("wmf", pics.get(5).suggestFileExtension());
|
||||||
assertEquals("application/x-wmf", pics.get(5).getMimeType());
|
assertEquals("image/x-wmf", pics.get(5).getMimeType());
|
||||||
assertEquals("jpg", pics.get(6).suggestFileExtension());
|
assertEquals("jpg", pics.get(6).suggestFileExtension());
|
||||||
assertEquals("image/jpeg", pics.get(6).getMimeType());
|
assertEquals("image/jpeg", pics.get(6).getMimeType());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue