OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * | 3 * |
4 * Portions are Copyright (C) 2001-6 mozilla.org | 4 * Portions are Copyright (C) 2001-6 mozilla.org |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Stuart Parmenter <stuart@mozilla.com> | 7 * Stuart Parmenter <stuart@mozilla.com> |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 return false; // I/O suspension. | 529 return false; // I/O suspension. |
530 | 530 |
531 // If we've completed image output... | 531 // If we've completed image output... |
532 ASSERT(m_info.output_scanline == m_info.output_height); | 532 ASSERT(m_info.output_scanline == m_info.output_height); |
533 m_state = JPEG_DONE; | 533 m_state = JPEG_DONE; |
534 } | 534 } |
535 // FALL THROUGH | 535 // FALL THROUGH |
536 | 536 |
537 case JPEG_DECOMPRESS_PROGRESSIVE: | 537 case JPEG_DECOMPRESS_PROGRESSIVE: |
538 if (m_state == JPEG_DECOMPRESS_PROGRESSIVE) { | 538 if (m_state == JPEG_DECOMPRESS_PROGRESSIVE) { |
539 int status; | 539 int status = 0; |
540 do { | 540 do { |
541 decoder_error_mgr* err = reinterpret_cast_ptr<decoder_error_
mgr *>(m_info.err); | 541 decoder_error_mgr* err = reinterpret_cast_ptr<decoder_error_
mgr *>(m_info.err); |
542 if (err->num_corrupt_warnings) | 542 if (err->num_corrupt_warnings) |
543 break; | 543 break; |
544 status = jpeg_consume_input(&m_info); | 544 status = jpeg_consume_input(&m_info); |
545 } while ((status != JPEG_SUSPENDED) && (status != JPEG_REACHED_E
OI)); | 545 } while ((status != JPEG_SUSPENDED) && (status != JPEG_REACHED_E
OI)); |
546 | 546 |
547 for (;;) { | 547 for (;;) { |
548 if (!m_info.output_scanline) { | 548 if (!m_info.output_scanline) { |
549 int scan = m_info.input_scan_number; | 549 int scan = m_info.input_scan_number; |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 // has failed. | 992 // has failed. |
993 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 993 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
994 setFailed(); | 994 setFailed(); |
995 | 995 |
996 // If decoding is done or failed, we don't need the JPEGImageReader anymore. | 996 // If decoding is done or failed, we don't need the JPEGImageReader anymore. |
997 if (isComplete(this, onlySize) || failed()) | 997 if (isComplete(this, onlySize) || failed()) |
998 m_reader.clear(); | 998 m_reader.clear(); |
999 } | 999 } |
1000 | 1000 |
1001 } | 1001 } |
OLD | NEW |