OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 m_bpc = m_bpc_orig; | 950 m_bpc = m_bpc_orig; |
951 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); | 951 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); |
952 if (pFilter) { | 952 if (pFilter) { |
953 if (pFilter->GetType() == PDFOBJ_NAME) { | 953 if (pFilter->GetType() == PDFOBJ_NAME) { |
954 CFX_ByteString filter = pFilter->GetString(); | 954 CFX_ByteString filter = pFilter->GetString(); |
955 if (filter == FX_BSTRC("CCITTFaxDecode") || | 955 if (filter == FX_BSTRC("CCITTFaxDecode") || |
956 filter == FX_BSTRC("JBIG2Decode")) { | 956 filter == FX_BSTRC("JBIG2Decode")) { |
957 m_bpc = 1; | 957 m_bpc = 1; |
958 m_nComponents = 1; | 958 m_nComponents = 1; |
959 } | 959 } |
960 if (filter == FX_BSTRC("RunLengthDecode") || | 960 if (filter == FX_BSTRC("RunLengthDecode")) { |
961 filter == FX_BSTRC("DCTDecode")) { | 961 if (m_bpc != 1) { |
| 962 m_bpc = 8; |
| 963 } |
| 964 } else if (filter == FX_BSTRC("DCTDecode")) { |
962 m_bpc = 8; | 965 m_bpc = 8; |
963 } | 966 } |
964 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { | 967 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { |
965 CPDF_Array* pArray = (CPDF_Array*)pFilter; | 968 CPDF_Array* pArray = (CPDF_Array*)pFilter; |
966 if (pArray->GetString(pArray->GetCount() - 1) == | 969 if (pArray->GetString(pArray->GetCount() - 1) == |
967 FX_BSTRC("CCITTFaxDecode") || | 970 FX_BSTRC("CCITTFaxDecode") || |
968 pArray->GetString(pArray->GetCount() - 1) == | 971 pArray->GetString(pArray->GetCount() - 1) == |
969 FX_BSTRC("JBIG2Decode")) { | 972 FX_BSTRC("JBIG2Decode")) { |
970 m_bpc = 1; | 973 m_bpc = 1; |
971 m_nComponents = 1; | 974 m_nComponents = 1; |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 } | 1666 } |
1664 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { | 1667 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { |
1665 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1668 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
1666 } | 1669 } |
1667 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1670 CPDF_ImageLoader::~CPDF_ImageLoader() { |
1668 if (!m_bCached) { | 1671 if (!m_bCached) { |
1669 delete m_pBitmap; | 1672 delete m_pBitmap; |
1670 delete m_pMask; | 1673 delete m_pMask; |
1671 } | 1674 } |
1672 } | 1675 } |
OLD | NEW |