Lines 159-186
Link Here
|
159 |
sessionContext.checkAllStreamsClosed(); |
159 |
sessionContext.checkAllStreamsClosed(); |
160 |
} |
160 |
} |
161 |
|
161 |
|
162 |
public void testICCProfiles() throws Exception { |
|
|
163 |
MyImageSessionContext sessionContext = createImageSessionContext(); |
164 |
List/* <ICC_Profile> */profiles = new ArrayList(); |
165 |
|
166 |
runReaders(profiles, sessionContext, "iccTest.png", "image/png", |
167 |
ImageFlavor.RAW_PNG); |
168 |
runReaders(profiles, sessionContext, "iccTest.jpg", "image/jpeg", |
169 |
ImageFlavor.RAW_JPEG); |
170 |
|
171 |
ICC_Profile first = (ICC_Profile) profiles.get(0); |
172 |
byte[] firstData = first.getData(); |
173 |
for (int i = 1; i < profiles.size(); i++) { |
174 |
ICC_Profile icc = (ICC_Profile) profiles.get(i); |
175 |
byte[] data = icc.getData(); |
176 |
assertEquals("Embedded ICC Profiles are not the same size!", |
177 |
firstData.length, data.length); |
178 |
for (int j = 0; j < firstData.length; j++) { |
179 |
assertEquals("Embedded ICC Profiles differ at index " + j, |
180 |
firstData[j], data[j]); |
181 |
} |
182 |
} |
183 |
} |
184 |
|
162 |
|
185 |
private void runReaders(List profiles, ImageSessionContext isc, String uri, |
163 |
private void runReaders(List profiles, ImageSessionContext isc, String uri, |
186 |
String mime, ImageFlavor rawFlavor) throws Exception { |
164 |
String mime, ImageFlavor rawFlavor) throws Exception { |