OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile(); | 323 qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile(); |
324 if (!deviceProfile) | 324 if (!deviceProfile) |
325 return false; | 325 return false; |
326 qcms_profile* inputProfile = qcms_profile_from_memory(data, size); | 326 qcms_profile* inputProfile = qcms_profile_from_memory(data, size); |
327 if (!inputProfile) | 327 if (!inputProfile) |
328 return false; | 328 return false; |
329 | 329 |
330 // We currently only support color profiles for RGB profiled images. | 330 // We currently only support color profiles for RGB profiled images. |
331 ASSERT(rgbData == qcms_profile_get_color_space(inputProfile)); | 331 ASSERT(rgbData == qcms_profile_get_color_space(inputProfile)); |
| 332 |
| 333 if (qcms_profile_match(inputProfile, deviceProfile)) { |
| 334 qcms_profile_release(inputProfile); |
| 335 return false; |
| 336 } |
| 337 |
332 // The input image pixels are RGBA format. | 338 // The input image pixels are RGBA format. |
333 qcms_data_type format = QCMS_DATA_RGBA_8; | 339 qcms_data_type format = QCMS_DATA_RGBA_8; |
334 // FIXME: Don't force perceptual intent if the image profile contains an int
ent. | 340 // FIXME: Don't force perceptual intent if the image profile contains an int
ent. |
335 m_transform = qcms_transform_create(inputProfile, format, deviceProfile, QCM
S_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL); | 341 m_transform = qcms_transform_create(inputProfile, format, deviceProfile, QCM
S_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL); |
336 | 342 |
337 qcms_profile_release(inputProfile); | 343 qcms_profile_release(inputProfile); |
338 return !!m_transform; | 344 return !!m_transform; |
339 } | 345 } |
340 | 346 |
341 void WEBPImageDecoder::readColorProfile() | 347 void WEBPImageDecoder::readColorProfile() |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 return false; | 557 return false; |
552 } | 558 } |
553 // FALLTHROUGH | 559 // FALLTHROUGH |
554 default: | 560 default: |
555 clear(); | 561 clear(); |
556 return setFailed(); | 562 return setFailed(); |
557 } | 563 } |
558 } | 564 } |
559 | 565 |
560 } // namespace blink | 566 } // namespace blink |
OLD | NEW |