OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 2001 mozilla.org | 5 * Portions are Copyright (C) 2001 mozilla.org |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Stuart Parmenter <stuart@mozilla.com> | 8 * Stuart Parmenter <stuart@mozilla.com> |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 if (profileLength < ImageDecoder::iccColorProfileHeaderLength) | 284 if (profileLength < ImageDecoder::iccColorProfileHeaderLength) |
285 ignoreProfile = true; | 285 ignoreProfile = true; |
286 else if (!ImageDecoder::rgbColorProfile(profileData, profileLength)) | 286 else if (!ImageDecoder::rgbColorProfile(profileData, profileLength)) |
287 ignoreProfile = true; | 287 ignoreProfile = true; |
288 else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength)) | 288 else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength)) |
289 ignoreProfile = true; | 289 ignoreProfile = true; |
290 | 290 |
291 ASSERT(colorProfile.isEmpty()); | 291 ASSERT(colorProfile.isEmpty()); |
292 if (!ignoreProfile) | 292 if (!ignoreProfile) |
293 colorProfile.append(profileData, profileLength); | 293 colorProfile.append(profileData, profileLength); |
294 #else | |
295 UNUSED_PARAM(png); | |
296 UNUSED_PARAM(info); | |
297 UNUSED_PARAM(colorProfile); | |
298 #endif | 294 #endif |
299 } | 295 } |
300 #endif | 296 #endif |
301 | 297 |
302 void PNGImageDecoder::headerAvailable() | 298 void PNGImageDecoder::headerAvailable() |
303 { | 299 { |
304 png_structp png = m_reader->pngPtr(); | 300 png_structp png = m_reader->pngPtr(); |
305 png_infop info = m_reader->infoPtr(); | 301 png_infop info = m_reader->infoPtr(); |
306 png_uint_32 width = png_get_image_width(png, info); | 302 png_uint_32 width = png_get_image_width(png, info); |
307 png_uint_32 height = png_get_image_height(png, info); | 303 png_uint_32 height = png_get_image_height(png, info); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // has failed. | 523 // has failed. |
528 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 524 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
529 setFailed(); | 525 setFailed(); |
530 // If we're done decoding the image, we don't need the PNGImageReader | 526 // If we're done decoding the image, we don't need the PNGImageReader |
531 // anymore. (If we failed, |m_reader| has already been cleared.) | 527 // anymore. (If we failed, |m_reader| has already been cleared.) |
532 else if (isComplete()) | 528 else if (isComplete()) |
533 m_reader.clear(); | 529 m_reader.clear(); |
534 } | 530 } |
535 | 531 |
536 } // namespace WebCore | 532 } // namespace WebCore |
OLD | NEW |