import Image image_path = '/game/pathon/24.jpg' img = Image.open(image_path) width,height = img.size print(width,height) Closed due to the fact that the issue is too general for the participants iluxa1810 , HamSter , aleksandr barakin , user194374, Denis Bubnov 25 Nov '16 at 21:14 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
|
1 answer
To import the Image module, you need to put the pillow package :
$ pip install pillow - Is it right in the code to register? - agre
- @agre if you don’t know “what
pip installand what the words “ put a python package ” mean ” then ask a separate Stack Overflow question (you can use the entire phrase inside “” in the form of a question header). - jfs
|
ModuleNotFoundError: No module named 'Image'in the header. If you ask about "how to import the Image module", then this question can be useful not only for people who want to get the "height and width of the image", but also for all those who have difficulty importing the Image module. - jfs