File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -656,6 +656,8 @@ def _get_imagemode(
656656 raise PdfReadError (
657657 "can not interprete colorspace" , color_space
658658 ) # pragma: no cover
659+ elif color_space [0 ].startswith ("/Cal" ): # /CalRGB and /CalGray
660+ color_space = "/Device" + color_space [0 ][4 :]
659661 elif color_space [0 ] == "/ICCBased" :
660662 icc_profile = color_space [1 ].get_object ()
661663 color_components = cast (int , icc_profile ["/N" ])
Original file line number Diff line number Diff line change @@ -440,6 +440,14 @@ def test_cascaded_filters_images():
440440 _ = i .name , i .image
441441
442442
443+ @pytest .mark .enable_socket ()
444+ def test_calrgb ():
445+ url = "https://github.com/py-pdf/pypdf/files/12061061/tt.pdf"
446+ name = "calRGB.pdf"
447+ reader = PdfReader (BytesIO (get_pdf_from_url (url , name = name )))
448+ reader .pages [0 ].images [0 ]
449+
450+
443451@pytest .mark .enable_socket ()
444452def test_2bits_image ():
445453 """From #1954, test with 2bits image. TODO: 4bits also"""
You can’t perform that action at this time.
0 commit comments