I've found a very strange jpeg file. (b.jpg)
This image has different sizes depending on which library you use, PIL or opencv.
For a comparative image (normal image), I created a.jpg.
The following code shows that the two libraries return different sizes!
What's wrong with this b.jpg ??
import cv2
from PIL import Image
a_path = "a.jpg"
b_path = "b.jpg"
PIL_a = Image.open(a_path)
CV2_a = cv2.imread(a_path)
PIL_b = Image.open(b_path)
CV2_b = cv2.imread(b_path)
PIL_a.size # width, height
>> (235, 149)
CV2_a.shape[1], CV2_a.shape[0] # width, height
>> (235, 149)
PIL_b.size # width, height
>> (5312, 2988)
CV2_b.shape[1], CV2_b.shape[0] # width, height
>> (2988, 5312) <-- strange