Bug 59742

Summary: XSLFPictureData is missing TIFF support
Product: POI Reporter: Jens Popp <jens.popp>
Component: XSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P2    
Version: 3.14-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Tiff file for test
JUnit Test

Description Jens Popp 2016-06-22 15:00:22 UTC
The getType and getRelationForType methods of XSLFPictureData deliver null for the TIFF format since version 3.14. The addPicutre in e.g. XMLSlideShow throws an IllegalArgumentException if a TIFF image is passed. PictureData and XSLFRelation have TIFF as image type.
Comment 1 Jens Popp 2016-06-22 15:24:19 UTC
Just adding 

	@Override
	public PictureType getType() {
...
		} else if (XSLFRelation.IMAGE_TIFF.getContentType().equals(ct)) {
			return PictureType.TIFF;
		} else {
			return null;
		}
	}

and

	/* package */ static XSLFRelation getRelationForType(PictureType pt) {
		switch (pt) {
			case EMF:
...
			case TIFF:
				return XSLFRelation.IMAGE_TIFF;
			default:
				return null;
		}
	}

Solves the problem
Comment 2 Nick Burch 2016-06-22 15:30:26 UTC
Any chance you could create a very small and simple .pptx file with a tiff image in, and upload it here along with some simple code that triggers this exception? We can then use that to test your patch, and also to verify it stays fixed into the future!
Comment 3 Jens Popp 2016-06-22 15:53:22 UTC
Created attachment 33972 [details]
Tiff file for test
Comment 4 Jens Popp 2016-06-22 15:54:00 UTC
Created attachment 33973 [details]
JUnit Test
Comment 5 Nick Burch 2016-06-22 16:18:53 UTC
Thanks! Unit test added, and patch applied in r1749732.