Bug 59742 - XSLFPictureData is missing TIFF support
Summary: XSLFPictureData is missing TIFF support
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.14-FINAL
Hardware: PC All
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-22 15:00 UTC by Jens Popp
Modified: 2016-06-22 16:18 UTC (History)
0 users



Attachments
Tiff file for test (11.95 KB, image/tiff)
2016-06-22 15:53 UTC, Jens Popp
Details
JUnit Test (1.08 KB, text/plain)
2016-06-22 15:54 UTC, Jens Popp
Details

Note You need to log in before you can comment on or make changes to this bug.
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.