1. Home
  2. /
  3. Blog
  4. /
  5. python program to Find Resolution of JPEG Image
Python

python program to Find Resolution of JPEG Image

September 27, 2022 1 min read 2,270
python program to Find Resolution of JPEG Image
num = int(input("Enter a number: "))   def jpeg_res(filename):     with open(filename,'rb') as img_file:         img_file.seek(163)         a = img_file.read(2)         height = (a[0] << 8) + a[1]         a = img_file.read(2)         width = (a[0] << 8) + a[1]     print("The resolution of the image is",width,"x",height)  jpeg_res("img1.jpg")
Share:
Read next

Related articles