File size: 300 Bytes
7a8c116
 
 
 
1bc7525
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
"""
ChatGPT-4 prompt: write a python function that given an image url gets its dimensions
"""

from PIL import Image
import requests
from io import BytesIO

def get_image_dimensions(image_url):
    response = requests.get(image_url)
    img = Image.open(BytesIO(response.content))
    return img.size