1
import Image


imageFile = "C:\Users\Abhi\Desktop\cbir-p\images.jpg"
im1 = Image.open(imageFile)



Error: 
File "C:\Users\Abhi\Desktop\cbir-p\im1.py", line 5, in <module>
    im1 = Image.open(imageFile)
  File "C:\Python27\lib\site-packages\PIL\Image.py", line 2025, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file

help me, I have installed all the necessary packages PIL ,Pillow ,Opencv etc.

4
  • 1
    stackoverflow.com/questions/16387069/open-images-python also make sure the imagepath is correct Commented Feb 20, 2014 at 6:13
  • 1
    You could also try using raw image paths as explained here: stackoverflow.com/a/21060179/1349663 Commented Feb 20, 2014 at 6:17
  • can you try from PIL import Image instead of image and let us know if any change occur Commented Feb 20, 2014 at 6:33
  • from PIL import Image works while import Image gives an error Commented Feb 20, 2014 at 15:07

1 Answer 1

1

hey it's not for your file path problem...

it's for your missing JPEG support in your PIL here is my solution explained here. https://apple.stackexchange.com/questions/59718/python-imaging-library-pil-decoder-jpeg-not-available-how-to-fix

Go to here to download the lib libjpeg package. or just

brew install libjpeg

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.