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(
656
656
raise PdfReadError (
657
657
"can not interprete colorspace" , color_space
658
658
) # pragma: no cover
659
+ elif color_space [0 ].startswith ("/Cal" ): # /CalRGB and /CalGray
660
+ color_space = "/Device" + color_space [0 ][4 :]
659
661
elif color_space [0 ] == "/ICCBased" :
660
662
icc_profile = color_space [1 ].get_object ()
661
663
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():
440
440
_ = i .name , i .image
441
441
442
442
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
+
443
451
@pytest .mark .enable_socket ()
444
452
def test_2bits_image ():
445
453
"""From #1954, test with 2bits image. TODO: 4bits also"""
You can’t perform that action at this time.
0 commit comments